diff options
Diffstat (limited to 'parts/tools/tools_part.cpp')
-rw-r--r-- | parts/tools/tools_part.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/parts/tools/tools_part.cpp b/parts/tools/tools_part.cpp index f4285546..f04e4ae3 100644 --- a/parts/tools/tools_part.cpp +++ b/parts/tools/tools_part.cpp @@ -1,11 +1,11 @@ #include "tools_part.h" -#include <qfile.h> -#include <qpopupmenu.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qvbox.h> -#include <qwhatsthis.h> +#include <tqfile.h> +#include <tqpopupmenu.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqvbox.h> +#include <tqwhatsthis.h> #include <kaction.h> #include <kapplication.h> @@ -37,9 +37,9 @@ static const KDevPluginInfo data("kdevtools"); K_EXPORT_COMPONENT_FACTORY( libkdevtools, ToolsFactory( data ) ) -QMap<int, QString> externalToolMenuEntries; +TQMap<int, TQString> externalToolMenuEntries; -ToolsPart::ToolsPart(QObject *parent, const char *name, const QStringList &) +ToolsPart::ToolsPart(TQObject *parent, const char *name, const TQStringList &) : KDevPlugin( &data, parent, name ? name : "ToolsPart") { setInstance(ToolsFactory::instance()); @@ -49,17 +49,17 @@ ToolsPart::ToolsPart(QObject *parent, const char *name, const QStringList &) m_configProxy = new ConfigWidgetProxy( core() ); m_configProxy->createGlobalConfigPage( i18n("Tools Menu"), TOOLSSETTINGS, info()->icon() ); m_configProxy->createGlobalConfigPage( i18n("External Tools"), EXTRATOOLSSETTINGS, info()->icon() ); - connect( m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )), - this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int )) ); + connect( m_configProxy, TQT_SIGNAL(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int )), + this, TQT_SLOT(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int )) ); - connect(core(), SIGNAL(coreInitialized()), this, SLOT(updateMenu())); + connect(core(), TQT_SIGNAL(coreInitialized()), this, TQT_SLOT(updateMenu())); - connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), - this, SLOT(contextMenu(QPopupMenu *, const Context *)) ); + connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)), + this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) ); // Apparently action lists can only be plugged after the // xmlgui client has been registered - QTimer::singleShot(0, this, SLOT(updateToolsMenu())); + TQTimer::singleShot(0, this, TQT_SLOT(updateToolsMenu())); } @@ -68,42 +68,42 @@ ToolsPart::~ToolsPart() delete m_configProxy; } -void ToolsPart::insertConfigWidget( const KDialogBase * dlg, QWidget * page, unsigned int pagenumber ) +void ToolsPart::insertConfigWidget( const KDialogBase * dlg, TQWidget * page, unsigned int pagenumber ) { if ( pagenumber == TOOLSSETTINGS ) { ToolsConfig *w = new ToolsConfig( page, "tools config widget" ); - connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); - connect(dlg, SIGNAL(destroyed()), this, SLOT(updateMenu())); + connect(dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept())); + connect(dlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(updateMenu())); } else if ( pagenumber == EXTRATOOLSSETTINGS ) { ToolsConfigWidget *w2 = new ToolsConfigWidget( page, "tools config widget" ); - connect(dlg, SIGNAL(okClicked()), w2, SLOT(accept())); - connect(dlg, SIGNAL(destroyed()), this, SLOT(updateToolsMenu())); + connect(dlg, TQT_SIGNAL(okClicked()), w2, TQT_SLOT(accept())); + connect(dlg, TQT_SIGNAL(destroyed()), this, TQT_SLOT(updateToolsMenu())); } } void ToolsPart::updateMenu() { - QPtrList<KAction> actions; + TQPtrList<KAction> actions; unplugActionList("tools_list"); KConfig *config = ToolsFactory::instance()->config(); config->setGroup("Tools"); - QStringList list = config->readListEntry("Tools"); - for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) + TQStringList list = config->readListEntry("Tools"); + for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it) { - QString name = *it; + TQString name = *it; KDesktopFile df(name, true); if (df.readName().isNull()) continue; KAction *action = new KAction(df.readName(), df.readIcon(), 0, - this, SLOT(slotToolActivated()), (QObject*)0, name.latin1()); + this, TQT_SLOT(slotToolActivated()), (TQObject*)0, name.latin1()); actions.append(action); } @@ -113,48 +113,48 @@ void ToolsPart::updateMenu() void ToolsPart::slotToolActivated() { - QString df = sender()->name(); + TQString df = sender()->name(); kapp->startServiceByDesktopPath(df); } -void ToolsPart::startCommand(QString cmdline, bool captured, QString fileName) +void ToolsPart::startCommand(TQString cmdline, bool captured, TQString fileName) { KTextEditor::Document * doc = dynamic_cast<KTextEditor::Document*>( partController()->activePart() ); if ( fileName.isNull() && doc ) fileName = doc->url().path(); - QString projectDirectory; + TQString projectDirectory; if (project()) projectDirectory = project()->projectDirectory(); - QString selection = KDevEditorUtil::currentSelection( doc ); + TQString selection = KDevEditorUtil::currentSelection( doc ); if ( !selection.isEmpty() ) selection = KShellProcess::quote( selection ); - QString word = KDevEditorUtil::currentWord( doc ); + TQString word = KDevEditorUtil::currentWord( doc ); // This should really be checked before inserting into the popup if (cmdline.contains("%D") && projectDirectory.isNull()) return; - cmdline.replace(QRegExp("%D"), projectDirectory); + cmdline.replace(TQRegExp("%D"), projectDirectory); if (cmdline.contains("%S") && fileName.isNull()) return; - cmdline.replace(QRegExp("%S"), fileName); + cmdline.replace(TQRegExp("%S"), fileName); if (cmdline.contains("%T") && selection.isNull()) return; - cmdline.replace(QRegExp("%T"), selection); + cmdline.replace(TQRegExp("%T"), selection); if (cmdline.contains("%W") && word.isNull()) return; - cmdline.replace(QRegExp("%W"), word); + cmdline.replace(TQRegExp("%W"), word); if (captured) { if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend")) - appFrontend->startAppCommand(QString::QString(), cmdline, false); + appFrontend->startAppCommand(TQString::TQString(), cmdline, false); } else { @@ -169,19 +169,19 @@ void ToolsPart::updateToolsMenu() { KConfig *config = ToolsFactory::instance()->config(); config->setGroup("External Tools"); - QStringList l = config->readListEntry("Tool Menu"); + TQStringList l = config->readListEntry("Tool Menu"); - QPtrList<KAction> actions; - QStringList::ConstIterator it; + TQPtrList<KAction> actions; + TQStringList::ConstIterator it; for (it = l.begin(); it != l.end(); ++it) { - QString menutext = *it; + TQString menutext = *it; KConfig *config = ToolsFactory::instance()->config(); config->setGroup("Tool Menu " + menutext); bool isdesktopfile = config->readBoolEntry("DesktopFile"); KAction *action = new KAction(*it, 0, - this, SLOT(toolsMenuActivated()), - (QObject*) 0, menutext.utf8()); + this, TQT_SLOT(toolsMenuActivated()), + (TQObject*) 0, menutext.utf8()); if (isdesktopfile) { KDesktopFile df(config->readPathEntry("CommandLine")); action->setIcon(df.readIcon()); @@ -194,7 +194,7 @@ void ToolsPart::updateToolsMenu() } -void ToolsPart::contextMenu(QPopupMenu *popup, const Context *context) +void ToolsPart::contextMenu(TQPopupMenu *popup, const Context *context) { if (!context->hasType( Context::FileContext )) return; @@ -206,28 +206,28 @@ void ToolsPart::contextMenu(QPopupMenu *popup, const Context *context) KConfig *config = ToolsFactory::instance()->config(); config->setGroup("External Tools"); - QStringList filecontextList = config->readListEntry("File Context"); + TQStringList filecontextList = config->readListEntry("File Context"); if (URLUtil::isDirectory(m_contextFileName)) { - QStringList l = config->readListEntry("Dir Context"); - QStringList::ConstIterator it; + TQStringList l = config->readListEntry("Dir Context"); + TQStringList::ConstIterator it; for (it = l.begin(); it != l.end(); ++it) - externalToolMenuEntries.insert( popup->insertItem( (*it), this, SLOT(dirContextActivated(int)) ), (*it) ); + externalToolMenuEntries.insert( popup->insertItem( (*it), this, TQT_SLOT(dirContextActivated(int)) ), (*it) ); } else { - QStringList l = config->readListEntry("File Context"); - QStringList::ConstIterator it; + TQStringList l = config->readListEntry("File Context"); + TQStringList::ConstIterator it; for (it = l.begin(); it != l.end(); ++it) - externalToolMenuEntries.insert( popup->insertItem( (*it), this, SLOT(fileContextActivated(int)) ), (*it) ); + externalToolMenuEntries.insert( popup->insertItem( (*it), this, TQT_SLOT(fileContextActivated(int)) ), (*it) ); } } void ToolsPart::toolsMenuActivated() { - QString menutext = sender()->name(); + TQString menutext = sender()->name(); KConfig *config = ToolsFactory::instance()->config(); config->setGroup("Tool Menu " + menutext); - QString cmdline = config->readPathEntry("CommandLine"); + TQString cmdline = config->readPathEntry("CommandLine"); bool isdesktopfile = config->readBoolEntry("DesktopFile"); bool captured = config->readBoolEntry("Captured"); kdDebug() << "tools:" << "activating " << menutext @@ -236,17 +236,17 @@ void ToolsPart::toolsMenuActivated() if (isdesktopfile) kapp->startServiceByDesktopPath(cmdline); else - startCommand(cmdline, captured, QString::null); + startCommand(cmdline, captured, TQString::null); } void ToolsPart::fileContextActivated(int id) { - QString menutext = externalToolMenuEntries[ id ]; + TQString menutext = externalToolMenuEntries[ id ]; KConfig *config = ToolsFactory::instance()->config(); config->setGroup("File Context " + menutext); - QString cmdline = config->readPathEntry("CommandLine"); + TQString cmdline = config->readPathEntry("CommandLine"); bool captured = config->readBoolEntry("Captured"); kdDebug() << "filecontext:" << "activating " << menutext << " with cmdline " << cmdline @@ -257,11 +257,11 @@ void ToolsPart::fileContextActivated(int id) void ToolsPart::dirContextActivated(int id) { - QString menutext = externalToolMenuEntries[ id ]; + TQString menutext = externalToolMenuEntries[ id ]; KConfig *config = ToolsFactory::instance()->config(); config->setGroup("Dir Context " + menutext); - QString cmdline = config->readPathEntry("CommandLine"); + TQString cmdline = config->readPathEntry("CommandLine"); bool captured = config->readBoolEntry("Captured"); kdDebug() << "dircontext:" << "activating " << menutext << "with cmdline " << cmdline |