diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /src/partcontroller.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/partcontroller.cpp')
-rw-r--r-- | src/partcontroller.cpp | 252 |
1 files changed, 126 insertions, 126 deletions
diff --git a/src/partcontroller.cpp b/src/partcontroller.cpp index 1fb15445..67047af6 100644 --- a/src/partcontroller.cpp +++ b/src/partcontroller.cpp @@ -2,14 +2,14 @@ #include <sys/stat.h> #include <unistd.h> -#include <qpopupmenu.h> -#include <qfile.h> -#include <qlayout.h> -#include <qmap.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qdom.h> +#include <tqpopupmenu.h> +#include <tqfile.h> +#include <tqlayout.h> +#include <tqmap.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqdom.h> #include <kmimetype.h> #include <kservice.h> @@ -76,9 +76,9 @@ using namespace MainWindowUtils; struct HistoryEntry { KURL url; - QString context; + TQString context; - HistoryEntry( const KURL& u, const QString& c ): url( u ), context( c ) {} + HistoryEntry( const KURL& u, const TQString& c ): url( u ), context( c ) {} }; struct ModificationData @@ -89,12 +89,12 @@ struct ModificationData }; -PartController::PartController(QWidget *parent) +PartController::PartController(TQWidget *parent) : KDevPartController(parent), _editorFactory(0L), m_currentActivePart(0), m_removingActivePart(false) { - connect(this, SIGNAL(partRemoved(KParts::Part*)), this, SLOT(slotPartRemoved(KParts::Part* )) ); - connect(this, SIGNAL(partAdded(KParts::Part*)), this, SLOT(slotPartAdded(KParts::Part* )) ); - connect(this, SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part*))); + connect(this, TQT_SIGNAL(partRemoved(KParts::Part*)), this, TQT_SLOT(slotPartRemoved(KParts::Part* )) ); + connect(this, TQT_SIGNAL(partAdded(KParts::Part*)), this, TQT_SLOT(slotPartAdded(KParts::Part* )) ); + connect(this, TQT_SIGNAL(activePartChanged(KParts::Part*)), this, TQT_SLOT(slotActivePartChanged(KParts::Part*))); setupActions(); @@ -109,7 +109,7 @@ PartController::~PartController() } -void PartController::createInstance(QWidget *parent) +void PartController::createInstance(TQWidget *parent) { if (!s_instance) s_instance = new PartController(parent); @@ -126,62 +126,62 @@ void PartController::setupActions() { KActionCollection *ac = TopLevel::getInstance()->main()->actionCollection(); - KAction* newAction = KStdAction::open(this, SLOT(slotOpenFile()), ac, "file_open"); + KAction* newAction = KStdAction::open(this, TQT_SLOT(slotOpenFile()), ac, "file_open"); newAction->setToolTip( i18n("Open file") ); newAction->setWhatsThis( i18n("<b>Open file</b><p>Opens an existing file without adding it to the project.</p>") ); - m_openRecentAction = KStdAction::openRecent( this, SLOT(slotOpenRecent(const KURL&) ), ac, "file_open_recent" ); - m_openRecentAction->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(m_openRecentAction->text())).arg(i18n("Opens recently opened file."))); + m_openRecentAction = KStdAction::openRecent( this, TQT_SLOT(slotOpenRecent(const KURL&) ), ac, "file_open_recent" ); + m_openRecentAction->setWhatsThis(TQString("<b>%1</b><p>%2").arg(beautifyToolTip(m_openRecentAction->text())).arg(i18n("Opens recently opened file."))); m_openRecentAction->loadEntries( kapp->config(), "RecentFiles" ); - m_saveAllFilesAction = new KAction(i18n("Save Al&l"), 0, this, SLOT(slotSaveAllFiles()), ac, "file_save_all"); + m_saveAllFilesAction = new KAction(i18n("Save Al&l"), 0, this, TQT_SLOT(slotSaveAllFiles()), ac, "file_save_all"); m_saveAllFilesAction->setToolTip( i18n("Save all modified files") ); m_saveAllFilesAction->setWhatsThis(i18n("<b>Save all</b><p>Saves all modified files.")); m_saveAllFilesAction->setEnabled(false); - m_revertAllFilesAction = new KAction(i18n("Rever&t All"), 0, this, SLOT(slotRevertAllFiles()), ac, "file_revert_all"); + m_revertAllFilesAction = new KAction(i18n("Rever&t All"), 0, this, TQT_SLOT(slotRevertAllFiles()), ac, "file_revert_all"); m_revertAllFilesAction->setToolTip(i18n("Revert all changes")); m_revertAllFilesAction->setWhatsThis(i18n("<b>Revert all</b><p>Reverts all changes in opened files. Prompts to save changes so the reversion can be canceled for each modified file.")); m_revertAllFilesAction->setEnabled(false); - m_closeWindowAction = KStdAction::close(this, SLOT(slotCloseWindow()), ac, "file_close"); + m_closeWindowAction = KStdAction::close(this, TQT_SLOT(slotCloseWindow()), ac, "file_close"); m_closeWindowAction->setToolTip( i18n("Close current file") ); - m_closeWindowAction->setWhatsThis(QString("<b>%1</b><p>%2").arg(beautifyToolTip(m_closeWindowAction->text())).arg(i18n("Closes current file."))); + m_closeWindowAction->setWhatsThis(TQString("<b>%1</b><p>%2").arg(beautifyToolTip(m_closeWindowAction->text())).arg(i18n("Closes current file."))); m_closeWindowAction->setEnabled(false); - m_closeAllWindowsAction = new KAction(i18n("Close All"), 0, this, SLOT(slotCloseAllWindows()), ac, "file_close_all"); + m_closeAllWindowsAction = new KAction(i18n("Close All"), 0, this, TQT_SLOT(slotCloseAllWindows()), ac, "file_close_all"); m_closeAllWindowsAction->setToolTip( i18n("Close all files") ); m_closeAllWindowsAction->setWhatsThis(i18n("<b>Close all</b><p>Close all opened files.")); m_closeAllWindowsAction->setEnabled(false); - m_closeOtherWindowsAction = new KAction(i18n("Close All Others"), 0, this, SLOT(slotCloseOtherWindows()), ac, "file_closeother"); + m_closeOtherWindowsAction = new KAction(i18n("Close All Others"), 0, this, TQT_SLOT(slotCloseOtherWindows()), ac, "file_closeother"); m_closeOtherWindowsAction->setToolTip( i18n("Close other files") ); m_closeOtherWindowsAction->setWhatsThis(i18n("<b>Close all others</b><p>Close all opened files except current.")); m_closeOtherWindowsAction->setEnabled(false); new KActionSeparator(ac, "dummy_separator"); - m_backAction = new KToolBarPopupAction(i18n("Back"), "back", 0, this, SLOT(slotBack()), ac, "history_back"); + m_backAction = new KToolBarPopupAction(i18n("Back"), "back", 0, this, TQT_SLOT(slotBack()), ac, "history_back"); m_backAction->setEnabled( false ); m_backAction->setToolTip(i18n("Back")); m_backAction->setWhatsThis(i18n("<b>Back</b><p>Moves backwards one step in the navigation history.")); - connect(m_backAction->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(slotBackAboutToShow())); - connect(m_backAction->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotBackPopupActivated(int))); + connect(m_backAction->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotBackAboutToShow())); + connect(m_backAction->popupMenu(), TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotBackPopupActivated(int))); - m_forwardAction = new KToolBarPopupAction(i18n("Forward"), "forward", 0, this, SLOT(slotForward()), ac, "history_forward"); + m_forwardAction = new KToolBarPopupAction(i18n("Forward"), "forward", 0, this, TQT_SLOT(slotForward()), ac, "history_forward"); m_forwardAction->setEnabled( false ); m_forwardAction->setToolTip(i18n("Forward")); m_forwardAction->setWhatsThis(i18n("<b>Forward</b><p>Moves forward one step in the navigation history.")); - connect(m_forwardAction->popupMenu(), SIGNAL(aboutToShow()), this, SLOT(slotForwardAboutToShow())); - connect(m_forwardAction->popupMenu(), SIGNAL(activated(int)), this, SLOT(slotForwardPopupActivated(int))); + connect(m_forwardAction->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotForwardAboutToShow())); + connect(m_forwardAction->popupMenu(), TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotForwardPopupActivated(int))); - m_gotoLastEditPosAction = new KAction( i18n("Goto Last Edit Position"), "bottom", 0, this, SLOT(gotoLastEditPos()), ac, "goto_last_edit_pos" ); + m_gotoLastEditPosAction = new KAction( i18n("Goto Last Edit Position"), "bottom", 0, this, TQT_SLOT(gotoLastEditPos()), ac, "goto_last_edit_pos" ); m_gotoLastEditPosAction->setEnabled( false ); m_gotoLastEditPosAction->setToolTip( i18n("Goto Last Edit Position") ); m_gotoLastEditPosAction->setWhatsThis( i18n("<b>Goto Last Edit Position</b><p>Open the last edited file and position cursor at the point of edit") ); } -void PartController::setEncoding(const QString &encoding) +void PartController::setEncoding(const TQString &encoding) { m_presetEncoding = encoding; } @@ -208,13 +208,13 @@ KParts::Part* PartController::findOpenDocument(const KURL& url) KURL PartController::findURLInProject(const KURL& url) { - QStringList fileList = API::getInstance()->project()->allFiles(); + TQStringList fileList = API::getInstance()->project()->allFiles(); bool filenameOnly = (url.url().find('/') == -1); - QString filename = filenameOnly ? "/" : ""; + TQString filename = filenameOnly ? "/" : ""; filename += url.url(); - for (QStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it) { + for (TQStringList::Iterator it = fileList.begin(); it != fileList.end(); ++it) { if ((*it).endsWith(filename)) { // Match! The first one is as good as any one, I guess... return KURL( API::getInstance()->project()->projectDirectory() + "/" + *it ); @@ -267,7 +267,7 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, { ei->setEncoding( m_presetEncoding ); } - m_presetEncoding = QString::null; + m_presetEncoding = TQString::null; } addHistoryEntry(); @@ -330,7 +330,7 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, url.cleanPath(true); if (url.isLocalFile()) { - QString path = url.path(); + TQString path = url.path(); path = URLUtil::canonicalPath(path); if ( !path.isEmpty() ) url.setPath(path); @@ -388,10 +388,10 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, // we don't trust KDE with designer files, let's handle it ourselves if ( !m_openNextAsText && MimeType->is( "application/x-designer" ) ) { - QString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" ); - QString designerExec = "designer"; - QStringList designerPluginPaths; - QDomDocument* dom = API::getInstance()->projectDom(); + TQString DesignerSetting = config->readEntry( "DesignerSetting", "ExternalDesigner" ); + TQString designerExec = "designer"; + TQStringList designerPluginPaths; + TQDomDocument* dom = API::getInstance()->projectDom(); if ( dom != 0 ) { // The global option specifies a fallback if the project @@ -419,7 +419,7 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, designerPart->openURL(url); return; } - else if ( KParts::Factory * KDevDesignerFactory = static_cast<KParts::Factory*>( KLibLoader::self()->factory( QFile::encodeName( "libkdevdesignerpart" ) ) ) ) + else if ( KParts::Factory * KDevDesignerFactory = static_cast<KParts::Factory*>( KLibLoader::self()->factory( TQFile::encodeName( "libkdevdesignerpart" ) ) ) ) { KParts::ReadWritePart * kdevpart = static_cast<KParts::ReadWritePart*>( KDevDesignerFactory->createPart( TopLevel::getInstance()->main(), 0, 0, 0, "KParts::ReadWritePart" ) ); kdevpart->openURL( url ); @@ -441,14 +441,14 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, config->setGroup("General"); - QStringList texttypeslist = config->readListEntry( "TextTypes" ); + TQStringList texttypeslist = config->readListEntry( "TextTypes" ); if ( texttypeslist.contains( MimeType->name() ) ) { m_openNextAsText = true; } bool isText = false; - QVariant v = MimeType->property("X-KDE-text"); + TQVariant v = MimeType->property("X-KDE-text"); if (v.isValid()) isText = v.toBool(); // is this regular text - open in editor @@ -460,8 +460,8 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, { if ( m_presetEncoding.isNull() && API::getInstance()->projectDom() ) { - QDomDocument * projectDom = API::getInstance()->projectDom(); - m_presetEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", QString::null ); + TQDomDocument * projectDom = API::getInstance()->projectDom(); + m_presetEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", TQString::null ); } if ( !m_presetEncoding.isNull() ) @@ -470,12 +470,12 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, { ei->setEncoding( m_presetEncoding ); } - m_presetEncoding = QString::null; + m_presetEncoding = TQString::null; } addHistoryEntry(); - QWidget * widget = EditorProxy::getInstance()->topWidgetForPart( editorpart ); + TQWidget * widget = EditorProxy::getInstance()->topWidgetForPart( editorpart ); integratePart(editorpart, url, widget, true, activate, addToCurrentBuffer); EditorProxy::getInstance()->setLineNumber(editorpart, lineNum, col); @@ -492,10 +492,10 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, // OK, it's not text and it's not a designer file.. let's see what else we can come up with.. KParts::Factory *factory = 0; - QString className; + TQString className; - QString services[] = { "KParts/ReadWritePart", "KParts/ReadOnlyPart" }; - QString classnames[] = { "KParts::ReadWritePart", "KParts::ReadOnlyPart" }; + TQString services[] = { "KParts/ReadWritePart", "KParts/ReadOnlyPart" }; + TQString classnames[] = { "KParts::ReadWritePart", "KParts::ReadOnlyPart" }; for (uint i=0; i<2; ++i) { factory = findPartFactory( MimeType->name(), services[i] ); @@ -534,10 +534,10 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, else { MimeWarningDialog dlg; - dlg.text2->setText( QString( "<qt><b>%1</b></qt>" ).arg(url.path())); + dlg.text2->setText( TQString( "<qt><b>%1</b></qt>" ).arg(url.path())); dlg.text3->setText( dlg.text3->text().arg(MimeType->name()) ); - if ( dlg.exec() == QDialog::Accepted ) + if ( dlg.exec() == TQDialog::Accepted ) { if ( dlg.open_with_kde->isChecked() ) { @@ -549,7 +549,7 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, { KConfig *config = kapp->config(); config->setGroup("General"); - QStringList texttypeslist = config->readListEntry( "TextTypes" ); + TQStringList texttypeslist = config->readListEntry( "TextTypes" ); texttypeslist << MimeType->name(); config->writeEntry( "TextTypes", texttypeslist ); } @@ -563,7 +563,7 @@ void PartController::editDocumentInternal( const KURL & inputUrl, int lineNum, void PartController::showDocument(const KURL &url, bool newWin) { - QString fixedPath = HTMLDocumentationPart::resolveEnvVarsInURL(url.url()); // possibly could env vars + TQString fixedPath = HTMLDocumentationPart::resolveEnvVarsInURL(url.url()); // possibly could env vars KURL docUrl(fixedPath); kdDebug(9000) << "SHOW: " << docUrl.url() << endl; @@ -581,8 +581,8 @@ void PartController::showDocument(const KURL &url, bool newWin) { part = new HTMLDocumentationPart; integratePart(part,docUrl); - connect(part, SIGNAL(fileNameChanged(KParts::ReadOnlyPart* )), - this, SIGNAL(partURLChanged(KParts::ReadOnlyPart* ))); + connect(part, TQT_SIGNAL(fileNameChanged(KParts::ReadOnlyPart* )), + this, TQT_SIGNAL(partURLChanged(KParts::ReadOnlyPart* ))); } else { @@ -591,9 +591,9 @@ void PartController::showDocument(const KURL &url, bool newWin) part->openURL(docUrl); } -KParts::Factory *PartController::findPartFactory(const QString &mimeType, const QString &partType, const QString &preferredName) +KParts::Factory *PartController::findPartFactory(const TQString &mimeType, const TQString &partType, const TQString &preferredName) { - KTrader::OfferList offers = KTrader::self()->query(mimeType, QString("'%1' in ServiceTypes").arg(partType)); + KTrader::OfferList offers = KTrader::self()->query(mimeType, TQString("'%1' in ServiceTypes").arg(partType)); if (offers.count() > 0) { @@ -611,7 +611,7 @@ KParts::Factory *PartController::findPartFactory(const QString &mimeType, const if ( !ptr ) { ptr = offers.first(); } - return static_cast<KParts::Factory*>(KLibLoader::self()->factory(QFile::encodeName(ptr->library()))); + return static_cast<KParts::Factory*>(KLibLoader::self()->factory(TQFile::encodeName(ptr->library()))); } return 0; @@ -639,7 +639,7 @@ KTextEditor::Editor * PartController::createEditorPart( bool activate, static bool alwaysActivate = true; kapp->config()->setGroup("Editor"); - QString preferred = kapp->config()->readPathEntry("EmbeddedKTextEditor"); + TQString preferred = kapp->config()->readPathEntry("EmbeddedKTextEditor"); // If we are not using kyzis... // Don't create non-wrapped views for now, // avoid two paths (== two chances for bad bugs) @@ -663,7 +663,7 @@ KTextEditor::Editor * PartController::createEditorPart( bool activate, } void PartController::integratePart(KParts::Part *part, const KURL &url, - QWidget* widget, bool isTextEditor, + TQWidget* widget, bool isTextEditor, bool activate, bool addToCurrentBuffer ) { if (!widget) widget = part->widget(); @@ -685,14 +685,14 @@ void PartController::integratePart(KParts::Part *part, const KURL &url, emit loadedFile( ro_part->url() ); - connect( part, SIGNAL(modifiedOnDisc(Kate::Document*, bool, unsigned char)), this, SLOT(slotDocumentDirty(Kate::Document*, bool, unsigned char)) ); + connect( part, TQT_SIGNAL(modifiedOnDisc(Kate::Document*, bool, unsigned char)), this, TQT_SLOT(slotDocumentDirty(Kate::Document*, bool, unsigned char)) ); // let's get notified when a document has been changed - connect(part, SIGNAL(completed()), this, SLOT(slotUploadFinished())); + connect(part, TQT_SIGNAL(completed()), this, TQT_SLOT(slotUploadFinished())); // yes, we're cheating again. this signal exists for katepart's // Document object and our HTMLDocumentationPart -// connect(part, SIGNAL(fileNameChanged()), this, SLOT(slotFileNameChanged())); +// connect(part, TQT_SIGNAL(fileNameChanged()), this, TQT_SLOT(slotFileNameChanged())); // Connect to the document's views newStatus() signal in order to keep track of the // modified-status of the document. @@ -704,22 +704,22 @@ void PartController::integratePart(KParts::Part *part, const KURL &url, if (designerPart && API::getInstance()->languageSupport()) { kdDebug() << "integrating designer part with language support" << endl; - connect(designerPart, SIGNAL(addedFunction(DesignerType, const QString&, Function )), + connect(designerPart, TQT_SIGNAL(addedFunction(DesignerType, const TQString&, Function )), API::getInstance()->languageSupport(), - SLOT(addFunction(DesignerType, const QString&, Function ))); - connect(designerPart, SIGNAL(editedFunction(DesignerType, const QString&, Function, Function )), API::getInstance()->languageSupport(), - SLOT(editFunction(DesignerType, const QString&, Function, Function ))); - connect(designerPart, SIGNAL(removedFunction(DesignerType, const QString&, Function )), + TQT_SLOT(addFunction(DesignerType, const TQString&, Function ))); + connect(designerPart, TQT_SIGNAL(editedFunction(DesignerType, const TQString&, Function, Function )), API::getInstance()->languageSupport(), + TQT_SLOT(editFunction(DesignerType, const TQString&, Function, Function ))); + connect(designerPart, TQT_SIGNAL(removedFunction(DesignerType, const TQString&, Function )), API::getInstance()->languageSupport(), - SLOT(removeFunction(DesignerType, const QString&, Function ))); - connect(designerPart, SIGNAL(editFunction(DesignerType, const QString&, const QString& )), + TQT_SLOT(removeFunction(DesignerType, const TQString&, Function ))); + connect(designerPart, TQT_SIGNAL(editFunction(DesignerType, const TQString&, const TQString& )), API::getInstance()->languageSupport(), - SLOT(openFunction(DesignerType, const QString&, const QString& ))); - connect(designerPart, SIGNAL(editSource(DesignerType, const QString& )), + TQT_SLOT(openFunction(DesignerType, const TQString&, const TQString& ))); + connect(designerPart, TQT_SIGNAL(editSource(DesignerType, const TQString& )), API::getInstance()->languageSupport(), - SLOT(openSource(DesignerType, const QString& ))); - connect(designerPart, SIGNAL(newStatus(const QString &, int)), - this, SLOT(slotNewDesignerStatus(const QString &, int))); + TQT_SLOT(openSource(DesignerType, const TQString& ))); + connect(designerPart, TQT_SIGNAL(newStatus(const TQString &, int)), + this, TQT_SLOT(slotNewDesignerStatus(const TQString &, int))); } } @@ -740,14 +740,14 @@ void PartController::integrateTextEditorPart(KTextEditor::Document* doc) if ( !doc ) return; - connect( doc, SIGNAL(textChanged()), this, SLOT(textChanged()) ); - connect( doc, SIGNAL(fileNameChanged()), - this, SLOT(slotDocumentUrlChanged())); + connect( doc, TQT_SIGNAL(textChanged()), this, TQT_SLOT(textChanged()) ); + connect( doc, TQT_SIGNAL(fileNameChanged()), + this, TQT_SLOT(slotDocumentUrlChanged())); if( doc->widget() ) { - connect( doc->widget(), SIGNAL(dropEventPass(QDropEvent *)), - TopLevel::getInstance()->main(), SLOT(slotDropEvent(QDropEvent *)) ); + connect( doc->widget(), TQT_SIGNAL(dropEventPass(TQDropEvent *)), + TopLevel::getInstance()->main(), TQT_SLOT(slotDropEvent(TQDropEvent *)) ); } if ( KTextEditor::View * view = dynamic_cast<KTextEditor::View*>( doc->widget() ) ) @@ -783,11 +783,11 @@ void PartController::integrateTextEditorPart(KTextEditor::Document* doc) // signals are dynamic, if we try to connect to an editorpart that lacks this signal, // all we get is a runtime warning. At this point in time we are only really supported // by katepart anyway so IMHO this hack is justified. //teatime - QPtrList<KTextEditor::View> list = doc->views(); - QPtrListIterator<KTextEditor::View> it( list ); + TQPtrList<KTextEditor::View> list = doc->views(); + TQPtrListIterator<KTextEditor::View> it( list ); while ( it.current() ) { - connect( it, SIGNAL( newStatus() ), this, SLOT( slotNewStatus() ) ); + connect( it, TQT_SIGNAL( newStatus() ), this, TQT_SLOT( slotNewStatus() ) ); ++it; } } @@ -864,7 +864,7 @@ void PartController::slotUploadFinished() KParts::ReadOnlyPart *PartController::partForURL(const KURL &url) { - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current()); @@ -874,9 +874,9 @@ KParts::ReadOnlyPart *PartController::partForURL(const KURL &url) return 0; } -KParts::Part * PartController::partForWidget( const QWidget * widget ) +KParts::Part * PartController::partForWidget( const TQWidget * widget ) { - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { if ( it.current()->widget() == widget ) @@ -892,7 +892,7 @@ void PartController::activatePart(KParts::Part *part) { if ( !part ) return; - QWidget * widget = EditorProxy::getInstance()->widgetForPart( part ); + TQWidget * widget = EditorProxy::getInstance()->widgetForPart( part ); if (widget) { TopLevel::getInstance()->raiseView( widget ); @@ -902,7 +902,7 @@ void PartController::activatePart(KParts::Part *part) setActivePart(part); - QWidget* w2 = EditorProxy::getInstance()->widgetForPart( part ); + TQWidget* w2 = EditorProxy::getInstance()->widgetForPart( part ); if (w2 != widget) w2->setFocus(); } @@ -916,7 +916,7 @@ bool PartController::closePart(KParts::Part *part) KURL url = ro_part->url(); - if (QWidget* w = EditorProxy::getInstance()->topWidgetForPart( part ) ) + if (TQWidget* w = EditorProxy::getInstance()->topWidgetForPart( part ) ) { if ( MultiBuffer *multiBuffer = dynamic_cast<MultiBuffer*>( w ) ) { @@ -974,7 +974,7 @@ void PartController::updateMenuItems() bool hasWriteParts = false; bool hasReadOnlyParts = false; - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { if (it.current()->inherits("KParts::ReadWritePart")) @@ -1059,7 +1059,7 @@ KURL::List PartController::modifiedDocuments() { KURL::List modFiles; - QPtrListIterator<KParts::Part> it( *parts() ); + TQPtrListIterator<KParts::Part> it( *parts() ); while( it.current() ) { KParts::ReadWritePart *rw_part = dynamic_cast<KParts::ReadWritePart*>(it.current()); @@ -1194,7 +1194,7 @@ bool PartController::saveFilesDialog( KURL::List const & ignoreList ) if ( modList.count() > 0 && modList != ignoreList ) { KSaveSelectDialog dlg( modList, ignoreList, TopLevel::getInstance()->main() ); - if ( dlg.exec() == QDialog::Accepted ) + if ( dlg.exec() == TQDialog::Accepted ) { saveFiles( dlg.filesToSave() ); clearModified( dlg.filesNotToSave() ); @@ -1211,8 +1211,8 @@ bool PartController::closeFilesDialog( KURL::List const & ignoreList ) { if ( !saveFilesDialog( ignoreList ) ) return false; - QPtrList<KParts::Part> partList( *parts() ); - QPtrListIterator<KParts::Part> it( partList ); + TQPtrList<KParts::Part> partList( *parts() ); + TQPtrListIterator<KParts::Part> it( partList ); while ( KParts::Part* part = it.current() ) { KParts::ReadOnlyPart * ro_part = dynamic_cast<KParts::ReadOnlyPart*>( part ); @@ -1273,10 +1273,10 @@ void PartController::slotCloseOtherWindows() void PartController::slotOpenFile() { - QString DefaultEncoding; - if ( QDomDocument * projectDom = API::getInstance()->projectDom() ) + TQString DefaultEncoding; + if ( TQDomDocument * projectDom = API::getInstance()->projectDom() ) { - DefaultEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", QString::null ); + DefaultEncoding = DomUtil::readEntry( *projectDom, "/general/defaultencoding", TQString::null ); } if ( DefaultEncoding.isEmpty() ) @@ -1284,11 +1284,11 @@ void PartController::slotOpenFile() // have a peek at katepart's settings: KConfig * config = kapp->config(); config->setGroup("Kate Document Defaults"); - DefaultEncoding = config->readEntry("Encoding", QString::null ); + DefaultEncoding = config->readEntry("Encoding", TQString::null ); } - KEncodingFileDialog::Result result = KEncodingFileDialog::getOpenURLsAndEncoding( DefaultEncoding, QString::null, - QString::null, TopLevel::getInstance()->main(), QString::null ); + KEncodingFileDialog::Result result = KEncodingFileDialog::getOpenURLsAndEncoding( DefaultEncoding, TQString::null, + TQString::null, TopLevel::getInstance()->main(), TQString::null ); for ( KURL::List::Iterator it = result.URLs.begin(); it != result.URLs.end(); ++it ) { @@ -1334,17 +1334,17 @@ void PartController::slotActivePartChanged( KParts::Part *part ) } updateMenuItems(); - QTimer::singleShot( 100, this, SLOT(slotWaitForFactoryHack()) ); + TQTimer::singleShot( 100, this, TQT_SLOT(slotWaitForFactoryHack()) ); } -void PartController::showPart( KParts::Part* part, const QString& name, const QString& shortDescription ) +void PartController::showPart( KParts::Part* part, const TQString& name, const TQString& shortDescription ) { if (!part->widget()) { /// @todo error handling return; // to avoid later crash } - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { if( it.current() == part ){ @@ -1366,7 +1366,7 @@ void PartController::slotDocumentDirty( Kate::Document * d, bool isModified, uns // KTextEditor::Document * doc = reinterpret_cast<KTextEditor::Document*>( d ); // theoretically unsafe in MI scenario KTextEditor::Document * doc = 0; - QPtrListIterator<KParts::Part> it( *parts() ); + TQPtrListIterator<KParts::Part> it( *parts() ); while( it.current() ) { if ( (void*)it.current() == (void*)d ) @@ -1386,7 +1386,7 @@ void PartController::slotDocumentDirty( Kate::Document * d, bool isModified, uns p->doc = doc; p->isModified = isModified; p->reason = reason; - KDevJobTimer::singleShot( 0, this, SLOT(slotDocumentDirtyStepTwo(void*)), p ); + KDevJobTimer::singleShot( 0, this, TQT_SLOT(slotDocumentDirtyStepTwo(void*)), p ); } } @@ -1399,9 +1399,9 @@ void PartController::slotDocumentDirtyStepTwo( void * payload ) // let's make sure the document is still loaded bool haveDocument = false; - if( const QPtrList<KParts::Part> * partlist = parts() ) + if( const TQPtrList<KParts::Part> * partlist = parts() ) { - QPtrListIterator<KParts::Part> it( *partlist ); + TQPtrListIterator<KParts::Part> it( *partlist ); while ( KParts::Part * part = it.current() ) { if ( p->doc == dynamic_cast<KTextEditor::Document*>( part ) ) @@ -1462,7 +1462,7 @@ bool PartController::reactToDirty( KURL const & url, unsigned char reason ) { KConfig *config = kapp->config(); config->setGroup("Editor"); - QString dirtyAction = config->readEntry( "DirtyAction" ); + TQString dirtyAction = config->readEntry( "DirtyAction" ); if ( dirtyAction == "nothing" ) return false; @@ -1511,7 +1511,7 @@ bool PartController::reactToDirty( KURL const & url, unsigned char reason ) return true; } -void PartController::slotNewDesignerStatus(const QString &formName, int status) +void PartController::slotNewDesignerStatus(const TQString &formName, int status) { kdDebug(9000) << k_funcinfo << endl; kdDebug(9000) << " formName: " << formName << ", status: " << status << endl; @@ -1522,7 +1522,7 @@ void PartController::slotNewStatus( ) { kdDebug(9000) << k_funcinfo << endl; - QObject * senderobj = const_cast<QObject*>( sender() ); + TQObject * senderobj = const_cast<TQObject*>( sender() ); KTextEditor::View * view = dynamic_cast<KTextEditor::View*>( senderobj ); if ( view ) { @@ -1564,7 +1564,7 @@ void PartController::doEmitState( KURL const & url ) KURL::List PartController::openURLs( ) { KURL::List list; - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { if ( KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(it.current()) ) @@ -1582,7 +1582,7 @@ KURL::List PartController::openURLs( ) PartController::HistoryEntry::HistoryEntry( const KURL & u, int l, int c) : url(u), line(l), col(c) { - id = abs( QTime::currentTime().msecsTo( QTime() ) ); // should provide a reasonably unique number + id = abs( TQTime::currentTime().msecsTo( TQTime() ) ); // should provide a reasonably unique number } void PartController::slotBack() @@ -1625,10 +1625,10 @@ void PartController::slotBackAboutToShow() if ( m_backHistory.isEmpty()) return; int i = 0; - QValueList<HistoryEntry>::ConstIterator it = m_backHistory.begin(); + TQValueList<HistoryEntry>::ConstIterator it = m_backHistory.begin(); while( i < 10 && it != m_backHistory.end() ) { - popup->insertItem( (*it).url.fileName() + QString(" (%1)").arg( (*it).line +1), (*it).id ); + popup->insertItem( (*it).url.fileName() + TQString(" (%1)").arg( (*it).line +1), (*it).id ); ++i; ++it; } @@ -1642,10 +1642,10 @@ void PartController::slotForwardAboutToShow( ) if ( m_forwardHistory.isEmpty() ) return; int i = 0; - QValueList<HistoryEntry>::ConstIterator it = m_forwardHistory.begin(); + TQValueList<HistoryEntry>::ConstIterator it = m_forwardHistory.begin(); while( i < 10 && it != m_forwardHistory.end() ) { - popup->insertItem( (*it).url.fileName() + QString(" (%1)").arg( (*it).line +1), (*it).id ); + popup->insertItem( (*it).url.fileName() + TQString(" (%1)").arg( (*it).line +1), (*it).id ); ++i; ++it; } @@ -1653,7 +1653,7 @@ void PartController::slotForwardAboutToShow( ) void PartController::slotBackPopupActivated( int id ) { - QValueList<HistoryEntry>::Iterator it = m_backHistory.begin(); + TQValueList<HistoryEntry>::Iterator it = m_backHistory.begin(); while( it != m_backHistory.end() ) { if ( (*it).id == id ) @@ -1678,7 +1678,7 @@ void PartController::slotBackPopupActivated( int id ) void PartController::slotForwardPopupActivated( int id ) { - QValueList<HistoryEntry>::Iterator it = m_forwardHistory.begin(); + TQValueList<HistoryEntry>::Iterator it = m_forwardHistory.begin(); while( it != m_forwardHistory.end() ) { if ( (*it).id == id ) @@ -1761,7 +1761,7 @@ void PartController::slotWaitForFactoryHack( ) { if ( !activePart()->factory() ) { - QTimer::singleShot( 100, this, SLOT(slotWaitForFactoryHack()) ); + TQTimer::singleShot( 100, this, TQT_SLOT(slotWaitForFactoryHack()) ); return; } else @@ -1785,7 +1785,7 @@ void PartController::slotWaitForFactoryHack( ) KParts::ReadOnlyPart *PartController::qtDesignerPart() { - QPtrListIterator<KParts::Part> it(*parts()); + TQPtrListIterator<KParts::Part> it(*parts()); for ( ; it.current(); ++it) { KInterfaceDesigner::Designer *des = dynamic_cast<KInterfaceDesigner::Designer*>(it.current()); @@ -1809,13 +1809,13 @@ KTextEditor::Editor *PartController::openTextDocument( bool activate ) if ( extension ) { KParts::URLArgs args; - args.serviceType = QString( "text/plain;" ) + m_presetEncoding; + args.serviceType = TQString( "text/plain;" ) + m_presetEncoding; extension->setURLArgs(args); } - m_presetEncoding = QString::null; + m_presetEncoding = TQString::null; } - QWidget * widget = + TQWidget * widget = EditorProxy::getInstance()->topWidgetForPart( editorpart ); addHistoryEntry(); @@ -1848,7 +1848,7 @@ void PartController::gotoLastEditPos() void PartController::slotDocumentUrlChanged() { - QObject *obj = const_cast<QObject*>(sender()); + TQObject *obj = const_cast<TQObject*>(sender()); KTextEditor::Document *doc = dynamic_cast<KTextEditor::Document*>( obj ); if (!doc) return; |