summaryrefslogtreecommitdiffstats
path: root/languages/ruby/rubysupport_part.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/ruby/rubysupport_part.cpp')
-rw-r--r--languages/ruby/rubysupport_part.cpp310
1 files changed, 155 insertions, 155 deletions
diff --git a/languages/ruby/rubysupport_part.cpp b/languages/ruby/rubysupport_part.cpp
index c116c05d..a8728c77 100644
--- a/languages/ruby/rubysupport_part.cpp
+++ b/languages/ruby/rubysupport_part.cpp
@@ -15,12 +15,12 @@
#include "kdevshellwidget.h"
#include "kdevquickopen.h"
-#include <qdir.h>
-#include <qwhatsthis.h>
-#include <qtimer.h>
-#include <qfileinfo.h>
-#include <qpopupmenu.h>
-#include <qregexp.h>
+#include <tqdir.h>
+#include <tqwhatsthis.h>
+#include <tqtimer.h>
+#include <tqfileinfo.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
#include <kiconloader.h>
#include <klocale.h>
@@ -41,7 +41,7 @@ typedef KDevGenericFactory<RubySupportPart> RubySupportFactory;
static const KDevPluginInfo data("kdevrubysupport");
K_EXPORT_COMPONENT_FACTORY( libkdevrubysupport, RubySupportFactory( data ) )
-RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStringList& )
+RubySupportPart::RubySupportPart(TQObject *parent, const char *name, const TQStringList& )
: KDevLanguageSupport (&data, parent, name ? name : "RubySupportPart" )
{
setInstance(RubySupportFactory::instance());
@@ -49,26 +49,26 @@ RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStrin
KAction *action;
action = new KAction( i18n("&Run"), "exec", SHIFT + Key_F9,
- this, SLOT(slotRun()),
+ this, TQT_SLOT(slotRun()),
actionCollection(), "build_execute" );
action->setToolTip(i18n("Run"));
action->setWhatsThis(i18n("<b>Run</b><p>Starts an application."));
action->setIcon("ruby_run.png");
action = new KAction( i18n("Run Test Under Cursor"), "exec", ALT + Key_F9,
- this, SLOT(slotRunTestUnderCursor()),
+ this, TQT_SLOT(slotRunTestUnderCursor()),
actionCollection(), "build_execute_test_function" );
action->setToolTip(i18n("Run Test Under Cursor"));
action->setWhatsThis(i18n("<b>Run Test Under Cursor</b><p>Runs the function under the cursor as test."));
- action = new KAction( i18n("Launch Browser"), "network", 0, this, SLOT(slotBrowse()), actionCollection(), "build_launch_browser" );
+ action = new KAction( i18n("Launch Browser"), "network", 0, this, TQT_SLOT(slotBrowse()), actionCollection(), "build_launch_browser" );
action->setToolTip(i18n("Launch Browser"));
action->setWhatsThis(i18n("<b>Launch Browser</b><p>Opens a web browser pointing to the Ruby Rails server") );
- action = new KAction( i18n("Switch To Controller"), 0, CTRL+ALT+Key_1, this, SLOT(slotSwitchToController()), actionCollection(), "switch_to_controller" );
- action = new KAction( i18n("Switch To Model"), 0, CTRL+ALT+Key_2, this, SLOT(slotSwitchToModel()), actionCollection(), "switch_to_model" );
- action = new KAction( i18n("Switch To View"), 0, CTRL+ALT+Key_3, this, SLOT(slotSwitchToView()), actionCollection(), "switch_to_view" );
- action = new KAction( i18n("Switch To Test"), 0, CTRL+ALT+Key_4, this, SLOT(slotSwitchToTest()), actionCollection(), "switch_to_test" );
+ action = new KAction( i18n("Switch To Controller"), 0, CTRL+ALT+Key_1, this, TQT_SLOT(slotSwitchToController()), actionCollection(), "switch_to_controller" );
+ action = new KAction( i18n("Switch To Model"), 0, CTRL+ALT+Key_2, this, TQT_SLOT(slotSwitchToModel()), actionCollection(), "switch_to_model" );
+ action = new KAction( i18n("Switch To View"), 0, CTRL+ALT+Key_3, this, TQT_SLOT(slotSwitchToView()), actionCollection(), "switch_to_view" );
+ action = new KAction( i18n("Switch To Test"), 0, CTRL+ALT+Key_4, this, TQT_SLOT(slotSwitchToTest()), actionCollection(), "switch_to_test" );
kdDebug() << "Creating RubySupportPart" << endl;
@@ -78,14 +78,14 @@ RubySupportPart::RubySupportPart(QObject *parent, const char *name, const QStrin
mainWindow()->embedOutputView( m_shellWidget, i18n("Ruby Shell"), i18n("Ruby Shell"));
mainWindow()->raiseView( m_shellWidget );
- connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) );
- connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) );
- connect( core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)),
- this, SLOT(contextMenu(QPopupMenu *, const Context *)) );
- connect( partController(), SIGNAL(savedFile(const KURL&)),
- this, SLOT(savedFile(const KURL&)) );
- connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)),
- this, SLOT(projectConfigWidget(KDialogBase*)) );
+ connect( core(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(projectOpened()) );
+ connect( core(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(projectClosed()) );
+ connect( core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)),
+ this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *)) );
+ connect( partController(), TQT_SIGNAL(savedFile(const KURL&)),
+ this, TQT_SLOT(savedFile(const KURL&)) );
+ connect( core(), TQT_SIGNAL(projectConfigWidget(KDialogBase*)),
+ this, TQT_SLOT(projectConfigWidget(KDialogBase*)) );
}
@@ -99,32 +99,32 @@ RubySupportPart::~RubySupportPart()
void RubySupportPart::projectConfigWidget(KDialogBase *dlg)
{
- QVBox *vbox = dlg->addVBoxPage(i18n("Ruby"), i18n("Ruby"), BarIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
- RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (QWidget *)vbox, "ruby config widget");
- connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) );
+ TQVBox *vbox = dlg->addVBoxPage(i18n("Ruby"), i18n("Ruby"), BarIcon("ruby_config.png", KIcon::SizeMedium, KIcon::DefaultState, RubySupportPart::instance()));
+ RubyConfigWidget *w = new RubyConfigWidget(*projectDom(), (TQWidget *)vbox, "ruby config widget");
+ connect( dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept()) );
}
void RubySupportPart::projectOpened()
{
kdDebug() << "projectOpened()" << endl;
- QStrList l;
+ TQStrList l;
l.append( shell().latin1() ) ;
m_shellWidget->setShell( shell().latin1(), l );
m_shellWidget->activate();
m_shellWidget->setAutoReactivateOnClose( true );
- connect( project(), SIGNAL(addedFilesToProject(const QStringList &)),
- this, SLOT(addedFilesToProject(const QStringList &)) );
- connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)),
- this, SLOT(removedFilesFromProject(const QStringList &)) );
+ connect( project(), TQT_SIGNAL(addedFilesToProject(const TQStringList &)),
+ this, TQT_SLOT(addedFilesToProject(const TQStringList &)) );
+ connect( project(), TQT_SIGNAL(removedFilesFromProject(const TQStringList &)),
+ this, TQT_SLOT(removedFilesFromProject(const TQStringList &)) );
- QFileInfo program(mainProgram());
+ TQFileInfo program(mainProgram());
// If it's a Rails project, create the project files if they're missing
if (mainProgram().endsWith("script/server")) {
- QString cmd;
- QFileInfo server(project()->projectDirectory() + "/script/server");
+ TQString cmd;
+ TQFileInfo server(project()->projectDirectory() + "/script/server");
if (! server.exists()) {
cmd += "rails " + project()->projectDirectory();
if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
@@ -134,12 +134,12 @@ void RubySupportPart::projectOpened()
// We want to parse only after all components have been
// properly initialized
- QTimer::singleShot(0, this, SLOT(initialParse()));
+ TQTimer::singleShot(0, this, TQT_SLOT(initialParse()));
}
-void RubySupportPart::maybeParse(const QString fileName)
+void RubySupportPart::maybeParse(const TQString fileName)
{
- QFileInfo fi(fileName);
+ TQFileInfo fi(fileName);
if (fi.extension() == "rb") {
if (codeModel()->hasFile(fileName)) {
@@ -158,8 +158,8 @@ void RubySupportPart::initialParse()
if (project()) {
kapp->setOverrideCursor(waitCursor);
- QStringList files = project()->allFiles();
- for (QStringList::Iterator it = files.begin(); it != files.end() ;++it) {
+ TQStringList files = project()->allFiles();
+ for (TQStringList::Iterator it = files.begin(); it != files.end() ;++it) {
kdDebug() << "maybe parse " << project()->projectDirectory() + "/" + (*it) << endl;
maybeParse(project()->projectDirectory() + "/" + *it);
}
@@ -171,28 +171,28 @@ void RubySupportPart::initialParse()
}
}
-void RubySupportPart::addedFilesToProject(const QStringList &fileList)
+void RubySupportPart::addedFilesToProject(const TQStringList &fileList)
{
kdDebug() << "addedFilesToProject()" << endl;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = fileList.begin(); it != fileList.end(); ++it )
{
- QString fileName = project()->projectDirectory() + "/" + ( *it );
+ TQString fileName = project()->projectDirectory() + "/" + ( *it );
maybeParse( fileName );
}
}
-void RubySupportPart::removedFilesFromProject(const QStringList &fileList)
+void RubySupportPart::removedFilesFromProject(const TQStringList &fileList)
{
kdDebug() << "removedFilesFromProject()" << endl;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = fileList.begin(); it != fileList.end(); ++it )
{
- QString fileName = project()->projectDirectory() + "/" + ( *it );
+ TQString fileName = project()->projectDirectory() + "/" + ( *it );
if( codeModel()->hasFile(fileName) ){
emit aboutToRemoveSourceInfo( fileName );
@@ -216,35 +216,35 @@ KDevLanguageSupport::Features RubySupportPart::features()
return Features(Classes | Functions | Variables | Declarations | Signals | Slots);
}
-void RubySupportPart::parse(const QString &fileName)
+void RubySupportPart::parse(const TQString &fileName)
{
- QFile f(QFile::encodeName(fileName));
+ TQFile f(TQFile::encodeName(fileName));
if (!f.open(IO_ReadOnly))
return;
- QTextStream stream(&f);
-
- QRegExp classre("^\\s*(class|module)\\s+([A-Z][A-Za-z0-9_]+::)*([A-Z][A-Za-z0-9_]+)\\s*(<\\s*([A-Z][A-Za-z0-9_:]+))?$");
- QRegExp methodre("^(\\s*)def\\s+(([A-Z][A-Za-z0-9_:]+|self)\\.)?([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~).*$");
- QRegExp accessre("^\\s*(private|protected|public)\\s*((:([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~),?\\s*)*)$");
- QRegExp attr_accessorre("^\\s*(attr_accessor|attr_reader|attr_writer)\\s*((:([A-Za-z0-9_]+),?\\s*)*)$");
- QRegExp symbolre(":([^,]+),?");
- QRegExp line_contre(",\\s*$");
- QRegExp slot_signalre("^\\s*(slots|signals|k_dcop|k_dcop_signals)\\s*(('[^)]+\\)',?\\s*)*)$");
- QRegExp memberre("'([A-Za-z0-9_ &*]+\\s)?([A-Za-z0-9_]+)\\([^)]*\\)',?");
- QRegExp begin_commentre("^*=begin");
- QRegExp end_commentre("^*=end");
- QRegExp variablere("(@@?[A-Za-z0-9_]+)\\s*=\\s*((?:([A-Za-z0-9_:.]+)\\.new)|[\\[\"'%:/\\?\\{]|%r|<<|true|false|^\\?|0[0-7]+|[-+]?0b[01]+|[-+]?0x[1-9a-fA-F]+|[-+]?[0-9_\\.e]+|nil)?");
- QRegExp endre("^(\\s*)end\\s*$");
+ TQTextStream stream(&f);
+
+ TQRegExp classre("^\\s*(class|module)\\s+([A-Z][A-Za-z0-9_]+::)*([A-Z][A-Za-z0-9_]+)\\s*(<\\s*([A-Z][A-Za-z0-9_:]+))?$");
+ TQRegExp methodre("^(\\s*)def\\s+(([A-Z][A-Za-z0-9_:]+|self)\\.)?([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~).*$");
+ TQRegExp accessre("^\\s*(private|protected|public)\\s*((:([A-Za-z0-9_]+[!?=]?|\\[\\]=?|\\*\\*||\\-|[!~+*/%&|><^]|>>|<<||<=>|<=|>=|==|===|!=|=~|!~),?\\s*)*)$");
+ TQRegExp attr_accessorre("^\\s*(attr_accessor|attr_reader|attr_writer)\\s*((:([A-Za-z0-9_]+),?\\s*)*)$");
+ TQRegExp symbolre(":([^,]+),?");
+ TQRegExp line_contre(",\\s*$");
+ TQRegExp slot_signalre("^\\s*(slots|signals|k_dcop|k_dcop_signals)\\s*(('[^)]+\\)',?\\s*)*)$");
+ TQRegExp memberre("'([A-Za-z0-9_ &*]+\\s)?([A-Za-z0-9_]+)\\([^)]*\\)',?");
+ TQRegExp begin_commentre("^*=begin");
+ TQRegExp end_commentre("^*=end");
+ TQRegExp variablere("(@@?[A-Za-z0-9_]+)\\s*=\\s*((?:([A-Za-z0-9_:.]+)\\.new)|[\\[\"'%:/\\?\\{]|%r|<<|true|false|^\\?|0[0-7]+|[-+]?0b[01]+|[-+]?0x[1-9a-fA-F]+|[-+]?[0-9_\\.e]+|nil)?");
+ TQRegExp endre("^(\\s*)end\\s*$");
FileDom m_file = codeModel()->create<FileModel>();
m_file->setName(fileName);
ClassDom lastClass;
FunctionDom lastMethod;
- QString lastMethodIndentation;
+ TQString lastMethodIndentation;
int lastAccess = CodeModelItem::Public;
- QString rawline;
- QCString line;
+ TQString rawline;
+ TQCString line;
int lineNo = 0;
while (!stream.atEnd()) {
@@ -261,7 +261,7 @@ void RubySupportPart::parse(const QString &fileName)
m_file->addClass( lastClass );
}
- QString parent = classre.cap(5);
+ TQString parent = classre.cap(5);
if (!parent.isEmpty())
{
kdDebug() << "Add parent " << parent << endl;
@@ -301,7 +301,7 @@ void RubySupportPart::parse(const QString &fileName)
lastMethod = method;
if (lastClass != 0) {
- QStringList scope( lastClass->name() );
+ TQStringList scope( lastClass->name() );
method->setScope( scope );
methodDecl->setScope( scope );
if( !lastClass->hasFunction(methodDecl->name()) ) {
@@ -339,7 +339,7 @@ void RubySupportPart::parse(const QString &fileName)
if (accessre.cap(2) == "") {
lastAccess = currentAccess;
} else {
- QString symbolList( accessre.cap(2) );
+ TQString symbolList( accessre.cap(2) );
int pos = 0;
while ( pos >= 0 ) {
@@ -364,7 +364,7 @@ void RubySupportPart::parse(const QString &fileName)
}
}
} else if (slot_signalre.search(line) != -1 && lastClass != 0) {
- QString memberList( slot_signalre.cap(2) );
+ TQString memberList( slot_signalre.cap(2) );
int pos = 0;
while ( pos >= 0 ) {
@@ -387,7 +387,7 @@ void RubySupportPart::parse(const QString &fileName)
} else {
method = codeModel()->create<FunctionModel>();
}
- QStringList scope( lastClass->name() );
+ TQStringList scope( lastClass->name() );
method->setScope( scope );
method->setName(memberre.cap(2));
method->setFileName( fileName );
@@ -405,8 +405,8 @@ void RubySupportPart::parse(const QString &fileName)
}
}
} else if (attr_accessorre.search(line) != -1 && lastClass != 0) {
- QString attr( attr_accessorre.cap(1) );
- QString symbolList( attr_accessorre.cap(2) );
+ TQString attr( attr_accessorre.cap(1) );
+ TQString symbolList( attr_accessorre.cap(2) );
int pos = 0;
while ( pos >= 0 ) {
@@ -422,7 +422,7 @@ void RubySupportPart::parse(const QString &fileName)
}
}
} else {
- QStringList scope( lastClass->name() );
+ TQStringList scope( lastClass->name() );
if ( !lastClass->hasFunction(symbolre.cap(1))
&& (attr == "attr_accessor" || attr == "attr_reader") )
{
@@ -462,7 +462,7 @@ void RubySupportPart::parse(const QString &fileName)
attr->setFileName( fileName );
attr->setStartPosition( lineNo, 0 );
attr->setAccess( CodeModelItem::Private );
- if (QRegExp("^@@").search(attr->name()) != -1) {
+ if (TQRegExp("^@@").search(attr->name()) != -1) {
attr->setStatic( true );
}
lastClass->addVariable( attr );
@@ -475,25 +475,25 @@ void RubySupportPart::parse(const QString &fileName)
attr->setStartPosition( lineNo, 0 );
}
- if (QRegExp("^(/|%r)").search(variablere.cap(2)) != -1) {
+ if (TQRegExp("^(/|%r)").search(variablere.cap(2)) != -1) {
attr->setType( "Regexp" );
- } else if (QRegExp("^[\"'%<]").search(variablere.cap(2)) != -1) {
+ } else if (TQRegExp("^[\"'%<]").search(variablere.cap(2)) != -1) {
attr->setType( "String" );
- } else if (QRegExp("^\\[").search(variablere.cap(2)) != -1) {
+ } else if (TQRegExp("^\\[").search(variablere.cap(2)) != -1) {
attr->setType( "Array" );
- } else if (QRegExp("^\\{").search(variablere.cap(2)) != -1) {
+ } else if (TQRegExp("^\\{").search(variablere.cap(2)) != -1) {
attr->setType( "Hash" );
- } else if (QRegExp("^:").search(variablere.cap(2)) != -1) {
+ } else if (TQRegExp("^:").search(variablere.cap(2)) != -1) {
attr->setType( "Symbol" );
- } else if (QRegExp("\\.\\.").search(variablere.cap(2)) != -1) {
+ } else if (TQRegExp("\\.\\.").search(variablere.cap(2)) != -1) {
attr->setType( "Range" );
} else if (variablere.cap(2) == "true" || variablere.cap(2) == "false") {
attr->setType( "Boolean" );
- } else if ( QRegExp("^[-+]?[0-9_]+").exactMatch(variablere.cap(2))
- || QRegExp("^[-+]?(0x|0|0b|\\?)").search(variablere.cap(2)) != -1 )
+ } else if ( TQRegExp("^[-+]?[0-9_]+").exactMatch(variablere.cap(2))
+ || TQRegExp("^[-+]?(0x|0|0b|\\?)").search(variablere.cap(2)) != -1 )
{
attr->setType( "Integer" );
- } else if (QRegExp("[0-9._]+(e[-+0-9]+)?").exactMatch(variablere.cap(2))) {
+ } else if (TQRegExp("[0-9._]+(e[-+0-9]+)?").exactMatch(variablere.cap(2))) {
attr->setType( "Float" );
} else if (variablere.cap(2) != "nil" && variablere.cap(3) != "") {
attr->setType( variablere.cap(3) );
@@ -520,10 +520,10 @@ void RubySupportPart::slotRun ()
// if we can't save all parts, then the user canceled
if ( partController()->saveAllFiles() == false )
return;
- QFileInfo program(mainProgram());
+ TQFileInfo program(mainProgram());
if (mainProgram().endsWith("script/server")) {
- QString cmd;
- QFileInfo server(project()->projectDirectory() + "/script/server");
+ TQString cmd;
+ TQFileInfo server(project()->projectDirectory() + "/script/server");
// Starting WEBrick for a Rails app. Translate a SIGTERM signal sent by KDevelop
// to a SIGINT expected by WEBrick (ie control&c) to terminate it.
@@ -531,7 +531,7 @@ void RubySupportPart::slotRun ()
if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
appFrontend->startAppCommand(project()->projectDirectory(), cmd, false);
} else {
- QString cmd = QString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
+ TQString cmd = TQString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
.arg(interpreter())
.arg(characterCoding())
.arg(runDirectory())
@@ -542,20 +542,20 @@ void RubySupportPart::slotRun ()
}
}
-QString RubySupportPart::interpreter() {
- QString prog = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/interpreter");
+TQString RubySupportPart::interpreter() {
+ TQString prog = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/interpreter");
if (prog.isEmpty()) prog = "ruby";
return prog;
}
-QString RubySupportPart::shell() {
- QString shell = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/shell");
+TQString RubySupportPart::shell() {
+ TQString shell = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/shell");
if (shell.isEmpty()) shell = "irb";
return shell;
}
-QString RubySupportPart::mainProgram() {
- QString prog;
+TQString RubySupportPart::mainProgram() {
+ TQString prog;
int runMainProgram = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/runmainprogram");
if (runMainProgram == 0) {
@@ -570,11 +570,11 @@ QString RubySupportPart::mainProgram() {
return prog;
}
-QString RubySupportPart::runDirectory() {
- QString cwd = DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globalcwd");
+TQString RubySupportPart::runDirectory() {
+ TQString cwd = DomUtil::readEntry(*projectDom(), "/kdevscriptproject/run/globalcwd");
if (cwd.isEmpty())
{
- QString mainProg = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/mainprogram");
+ TQString mainProg = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/mainprogram");
KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
if (mainProg.isEmpty() && ro_part)
cwd = ro_part->url().directory();
@@ -584,14 +584,14 @@ QString RubySupportPart::runDirectory() {
return cwd;
}
-QString RubySupportPart::programArgs() {
- QString args = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/programargs");
+TQString RubySupportPart::programArgs() {
+ TQString args = DomUtil::readEntry(*projectDom(), "/kdevrubysupport/run/programargs");
return args;
}
-QString RubySupportPart::characterCoding() {
+TQString RubySupportPart::characterCoding() {
int coding = DomUtil::readIntEntry(*projectDom(), "/kdevrubysupport/run/charactercoding");
- QString code("A");
+ TQString code("A");
switch (coding) {
case 0:
@@ -611,10 +611,10 @@ QString RubySupportPart::characterCoding() {
}
-void RubySupportPart::startApplication(const QString &program) {
+void RubySupportPart::startApplication(const TQString &program) {
bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevrubysupport/run/terminal");
if (KDevAppFrontend *appFrontend = extension<KDevAppFrontend>("KDevelop/AppFrontend"))
- appFrontend->startAppCommand(QString::QString(), program, inTerminal);
+ appFrontend->startAppCommand(TQString::TQString(), program, inTerminal);
}
@@ -651,7 +651,7 @@ KDevDesignerIntegration *RubySupportPart::designer(KInterfaceDesigner::DesignerT
void RubySupportPart::projectClosed( )
{
- for (QMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*>::const_iterator it = m_designers.begin();
+ for (TQMap<KInterfaceDesigner::DesignerType, KDevDesignerIntegration*>::const_iterator it = m_designers.begin();
it != m_designers.end(); ++it)
{
kdDebug() << "calling save settings fro designer integration" << endl;
@@ -659,7 +659,7 @@ void RubySupportPart::projectClosed( )
}
}
-void RubySupportPart::contextMenu( QPopupMenu * popup, const Context * context )
+void RubySupportPart::contextMenu( TQPopupMenu * popup, const Context * context )
{
if (context->hasType(Context::FileContext)){
const FileContext *fc = static_cast<const FileContext*>(context);
@@ -668,7 +668,7 @@ void RubySupportPart::contextMenu( QPopupMenu * popup, const Context * context )
if (url.fileName().endsWith(".ui"))
{
m_contextFileName = url.fileName();
- int id = popup->insertItem(i18n("Create or Select Implementation..."), this, SLOT(slotCreateSubclass()));
+ int id = popup->insertItem(i18n("Create or Select Implementation..."), this, TQT_SLOT(slotCreateSubclass()));
popup->setWhatsThis(id, i18n("<b>Create or select implementation</b><p>Creates or selects a subclass of selected form for use with integrated KDevDesigner."));
}
}
@@ -676,7 +676,7 @@ void RubySupportPart::contextMenu( QPopupMenu * popup, const Context * context )
void RubySupportPart::slotCreateSubclass()
{
- QFileInfo fi(m_contextFileName);
+ TQFileInfo fi(m_contextFileName);
if (fi.extension(false) != "ui")
return;
QtDesignerRubyIntegration *des = dynamic_cast<QtDesignerRubyIntegration*>(designer(KInterfaceDesigner::QtDesigner));
@@ -697,18 +697,18 @@ void RubySupportPart::slotSwitchToController()
KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
if (!ropart)
return;
- QFileInfo file(ropart->url().path());
+ TQFileInfo file(ropart->url().path());
if (!file.exists())
return;
- QString ext = file.extension();
- QString name = file.baseName();
- QString switchTo = "";
+ TQString ext = file.extension();
+ TQString name = file.baseName();
+ TQString switchTo = "";
if ((ext == "rb") && !name.endsWith("_controller"))
{
if (name.endsWith("_test"))
{
- switchTo = name.remove(QRegExp("_test$")); //the file is the test
- switchTo = name.remove(QRegExp("_controller$")); //remove functional test name parts
+ switchTo = name.remove(TQRegExp("_test$")); //the file is the test
+ switchTo = name.remove(TQRegExp("_controller$")); //remove functional test name parts
}
else
switchTo = name;
@@ -719,14 +719,14 @@ void RubySupportPart::slotSwitchToController()
//the controller basing on the directory information
switchTo = file.dir().dirName();
}
- QString controllersDir = project()->projectDirectory() + "/app/controllers/";
+ TQString controllersDir = project()->projectDirectory() + "/app/controllers/";
if (!switchTo.isEmpty())
{
if (switchTo.endsWith("s"))
switchTo = switchTo.mid(0, switchTo.length()-1);
- QString singular = controllersDir + switchTo + "_controller.rb";
- QString plural = controllersDir + switchTo + "s_controller.rb";
- KURL url = KURL::fromPathOrURL(QFile::exists(singular) ? singular : plural);
+ TQString singular = controllersDir + switchTo + "_controller.rb";
+ TQString plural = controllersDir + switchTo + "s_controller.rb";
+ KURL url = KURL::fromPathOrURL(TQFile::exists(singular) ? singular : plural);
partController()->editDocument(url);
}
}
@@ -739,12 +739,12 @@ void RubySupportPart::slotSwitchToTest()
KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
if (!ropart)
return;
- QFileInfo file(ropart->url().path());
+ TQFileInfo file(ropart->url().path());
if (!file.exists())
return;
- QString ext = file.extension();
- QString name = file.baseName();
- QString switchTo = "";
+ TQString ext = file.extension();
+ TQString name = file.baseName();
+ TQString switchTo = "";
if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
{
@@ -752,7 +752,7 @@ void RubySupportPart::slotSwitchToTest()
switchTo = file.dir().dirName();
}
else if (ext == "rb")
- switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+ switchTo = name.remove(TQRegExp("_controller$")).remove(TQRegExp("_controller_test$")).remove(TQRegExp("_test$"));
if (switchTo.isEmpty())
return;
@@ -761,19 +761,19 @@ void RubySupportPart::slotSwitchToTest()
switchTo = switchTo.mid(0, switchTo.length() - 1);
KURL::List urls;
- QString testDir = project()->projectDirectory() + "/test/";
- QString functionalTestS = testDir + "functional/" + switchTo + "_controller_test.rb";
- QString functionalTestP = testDir + "functional/" + switchTo + "s_controller_test.rb";
- QString integrationTestS = testDir + "integration/" + switchTo + "_test.rb";
- QString integrationTestP = testDir + "integration/" + switchTo + "s_test.rb";
- QString unitTestS = testDir + "unit/" + switchTo + "_test.rb";
- QString unitTestP = testDir + "unit/" + switchTo + "s_test.rb";
- if (QFile::exists(functionalTestP)) urls << KURL::fromPathOrURL(functionalTestP);
- if (QFile::exists(integrationTestP)) urls << KURL::fromPathOrURL(integrationTestP);
- if (QFile::exists(unitTestP)) urls << KURL::fromPathOrURL(unitTestP);
- if (QFile::exists(functionalTestS)) urls << KURL::fromPathOrURL(functionalTestS);
- if (QFile::exists(integrationTestS)) urls << KURL::fromPathOrURL(integrationTestS);
- if (QFile::exists(unitTestS)) urls << KURL::fromPathOrURL(unitTestS);
+ TQString testDir = project()->projectDirectory() + "/test/";
+ TQString functionalTestS = testDir + "functional/" + switchTo + "_controller_test.rb";
+ TQString functionalTestP = testDir + "functional/" + switchTo + "s_controller_test.rb";
+ TQString integrationTestS = testDir + "integration/" + switchTo + "_test.rb";
+ TQString integrationTestP = testDir + "integration/" + switchTo + "s_test.rb";
+ TQString unitTestS = testDir + "unit/" + switchTo + "_test.rb";
+ TQString unitTestP = testDir + "unit/" + switchTo + "s_test.rb";
+ if (TQFile::exists(functionalTestP)) urls << KURL::fromPathOrURL(functionalTestP);
+ if (TQFile::exists(integrationTestP)) urls << KURL::fromPathOrURL(integrationTestP);
+ if (TQFile::exists(unitTestP)) urls << KURL::fromPathOrURL(unitTestP);
+ if (TQFile::exists(functionalTestS)) urls << KURL::fromPathOrURL(functionalTestS);
+ if (TQFile::exists(integrationTestS)) urls << KURL::fromPathOrURL(integrationTestS);
+ if (TQFile::exists(unitTestS)) urls << KURL::fromPathOrURL(unitTestS);
KDevQuickOpen *qo = extension<KDevQuickOpen>("KDevelop/QuickOpen");
if (qo && !urls.isEmpty())
@@ -788,12 +788,12 @@ void RubySupportPart::slotSwitchToModel()
KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
if (!ropart)
return;
- QFileInfo file(ropart->url().path());
+ TQFileInfo file(ropart->url().path());
if (!file.exists())
return;
- QString ext = file.extension();
- QString name = file.baseName();
- QString switchTo = "";
+ TQString ext = file.extension();
+ TQString name = file.baseName();
+ TQString switchTo = "";
if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
{
@@ -802,7 +802,7 @@ void RubySupportPart::slotSwitchToModel()
}
else if (ext == "rb" && (name.endsWith("_controller") || name.endsWith("_test")))
{
- switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+ switchTo = name.remove(TQRegExp("_controller$")).remove(TQRegExp("_controller_test$")).remove(TQRegExp("_test$"));
}
if (switchTo.isEmpty())
@@ -811,10 +811,10 @@ void RubySupportPart::slotSwitchToModel()
if (switchTo.endsWith("s"))
switchTo = switchTo.mid(0, switchTo.length() - 1);
- QString modelsDir = project()->projectDirectory() + "/app/models/";
- QString singular = modelsDir + switchTo + "_controller.rb";
- QString plural = modelsDir + switchTo + "s_controller.rb";
- KURL url = KURL::fromPathOrURL(QFile::exists(singular) ? singular : plural);
+ TQString modelsDir = project()->projectDirectory() + "/app/models/";
+ TQString singular = modelsDir + switchTo + "_controller.rb";
+ TQString plural = modelsDir + switchTo + "s_controller.rb";
+ KURL url = KURL::fromPathOrURL(TQFile::exists(singular) ? singular : plural);
partController()->editDocument(KURL::fromPathOrURL(modelsDir + switchTo + ".rb"));
}
@@ -827,12 +827,12 @@ void RubySupportPart::slotSwitchToView()
KParts::ReadOnlyPart *ropart = dynamic_cast<KParts::ReadOnlyPart*>(activePart);
if (!ropart)
return;
- QFileInfo file(ropart->url().path());
+ TQFileInfo file(ropart->url().path());
if (!file.exists())
return;
- QString ext = file.extension();
- QString name = file.baseName();
- QString switchTo = "";
+ TQString ext = file.extension();
+ TQString name = file.baseName();
+ TQString switchTo = "";
if (ext == "rjs" || ext == "rxml" || ext == "rhtml" || ext == "js.rjs" || ext == "xml.builder" || ext == "html.erb")
{
@@ -840,7 +840,7 @@ void RubySupportPart::slotSwitchToView()
switchTo = file.dir().dirName();
}
else if (ext == "rb")
- switchTo = name.remove(QRegExp("_controller$")).remove(QRegExp("_controller_test$")).remove(QRegExp("_test$"));
+ switchTo = name.remove(TQRegExp("_controller$")).remove(TQRegExp("_controller_test$")).remove(TQRegExp("_test$"));
if (switchTo.isEmpty())
return;
@@ -849,9 +849,9 @@ void RubySupportPart::slotSwitchToView()
switchTo = switchTo.mid(0, switchTo.length() - 1);
KURL::List urls;
- QDir viewsDir;
- QDir viewsDirS = QDir(project()->projectDirectory() + "/app/views/" + switchTo);
- QDir viewsDirP = QDir(project()->projectDirectory() + "/app/views/" + switchTo + "s");
+ TQDir viewsDir;
+ TQDir viewsDirS = TQDir(project()->projectDirectory() + "/app/views/" + switchTo);
+ TQDir viewsDirP = TQDir(project()->projectDirectory() + "/app/views/" + switchTo + "s");
if (viewsDirS.exists())
viewsDir = viewsDirS;
else if (viewsDirP.exists())
@@ -859,11 +859,11 @@ void RubySupportPart::slotSwitchToView()
else
return;
- QStringList views = viewsDir.entryList();
+ TQStringList views = viewsDir.entryList();
- for (QStringList::const_iterator it = views.begin(); it != views.end(); ++it)
+ for (TQStringList::const_iterator it = views.begin(); it != views.end(); ++it)
{
- QString viewName = *it;
+ TQString viewName = *it;
if ( !(viewName.endsWith("~") || viewName == "." || viewName == "..") )
urls << KURL::fromPathOrURL(viewsDir.absPath() + "/" + viewName);
}
@@ -879,7 +879,7 @@ void RubySupportPart::slotRunTestUnderCursor()
return;
KParts::ReadOnlyPart *ro_part = dynamic_cast<KParts::ReadOnlyPart*>(partController()->activePart());
- QString prog;
+ TQString prog;
if (ro_part != 0) {
prog = ro_part->url().path();
} else
@@ -894,8 +894,8 @@ void RubySupportPart::slotRunTestUnderCursor()
FunctionDom fun = hlp.functionAt(line, column);
if (fun == 0) return;
- QFileInfo program(prog);
- QString cmd = QString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
+ TQFileInfo program(prog);
+ TQString cmd = TQString("%1 -K%2 -C\"%3\" -I\"%4\" \"%5\" %6")
.arg(interpreter())
.arg(characterCoding())
.arg(runDirectory())