diff options
Diffstat (limited to 'kdbg/mainwndbase.cpp')
-rw-r--r-- | kdbg/mainwndbase.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/kdbg/mainwndbase.cpp b/kdbg/mainwndbase.cpp index 924e5a7..2c97c41 100644 --- a/kdbg/mainwndbase.cpp +++ b/kdbg/mainwndbase.cpp @@ -10,9 +10,9 @@ #include <kmessagebox.h> #include <kstatusbar.h> #include <kfiledialog.h> -#include <qtabdialog.h> -#include <qfile.h> -#include <qdragobject.h> +#include <ntqtabdialog.h> +#include <ntqfile.h> +#include <ntqdragobject.h> #include "mainwndbase.h" #include "debugger.h" #include "gdbdriver.h" @@ -37,8 +37,8 @@ #define MAX_RECENT_FILES 4 -WatchWindow::WatchWindow(QWidget* parent, const char* name, WFlags f) : - QWidget(parent, name, f), +WatchWindow::WatchWindow(TQWidget* parent, const char* name, WFlags f) : + TQWidget(parent, name, f), m_watchEdit(this, "watch_edit"), m_watchAdd(i18n(" Add "), this, "watch_add"), m_watchDelete(i18n(" Del "), this, "watch_delete"), @@ -58,7 +58,7 @@ WatchWindow::WatchWindow(QWidget* parent, const char* name, WFlags f) : connect(&m_watchEdit, SIGNAL(returnPressed()), SIGNAL(addWatch())); connect(&m_watchAdd, SIGNAL(clicked()), SIGNAL(addWatch())); connect(&m_watchDelete, SIGNAL(clicked()), SIGNAL(deleteWatch())); - connect(&m_watchVariables, SIGNAL(currentChanged(QListViewItem*)), + connect(&m_watchVariables, SIGNAL(currentChanged(TQListViewItem*)), SLOT(slotWatchHighlighted())); m_watchVariables.installEventFilter(this); @@ -69,11 +69,11 @@ WatchWindow::~WatchWindow() { } -bool WatchWindow::eventFilter(QObject*, QEvent* ev) +bool WatchWindow::eventFilter(TQObject*, TQEvent* ev) { - if (ev->type() == QEvent::KeyPress) + if (ev->type() == TQEvent::KeyPress) { - QKeyEvent* kev = static_cast<QKeyEvent*>(ev); + TQKeyEvent* kev = static_cast<TQKeyEvent*>(ev); if (kev->key() == Key_Delete) { emit deleteWatch(); return true; @@ -82,15 +82,15 @@ bool WatchWindow::eventFilter(QObject*, QEvent* ev) return false; } -void WatchWindow::dragEnterEvent(QDragEnterEvent* event) +void WatchWindow::dragEnterEvent(TQDragEnterEvent* event) { - event->accept(QTextDrag::canDecode(event)); + event->accept(TQTextDrag::canDecode(event)); } -void WatchWindow::dropEvent(QDropEvent* event) +void WatchWindow::dropEvent(TQDropEvent* event) { - QString text; - if (QTextDrag::decode(event, text)) + TQString text; + if (TQTextDrag::decode(event, text)) { // pick only the first line text = text.stripWhiteSpace(); @@ -108,7 +108,7 @@ void WatchWindow::dropEvent(QDropEvent* event) void WatchWindow::slotWatchHighlighted() { VarTree* expr = m_watchVariables.selectedItem(); - QString text = expr ? expr->computeExpr() : QString(); + TQString text = expr ? expr->computeExpr() : TQString(); m_watchEdit.setText(text); } @@ -147,46 +147,46 @@ DebuggerMainWndBase::~DebuggerMainWndBase() } } -void DebuggerMainWndBase::setupDebugger(QWidget* parent, +void DebuggerMainWndBase::setupDebugger(TQWidget* parent, ExprWnd* localVars, ExprWnd* watchVars, - QListBox* backtrace) + TQListBox* backtrace) { m_debugger = new KDebugger(parent, localVars, watchVars, backtrace); - QObject::connect(m_debugger, SIGNAL(updateStatusMessage()), + TQObject::connect(m_debugger, SIGNAL(updateStatusMessage()), parent, SLOT(slotNewStatusMsg())); - QObject::connect(m_debugger, SIGNAL(updateUI()), + TQObject::connect(m_debugger, SIGNAL(updateUI()), parent, SLOT(updateUI())); - QObject::connect(m_debugger, SIGNAL(breakpointsChanged()), + TQObject::connect(m_debugger, SIGNAL(breakpointsChanged()), parent, SLOT(updateLineItems())); - QObject::connect(m_debugger, SIGNAL(debuggerStarting()), + TQObject::connect(m_debugger, SIGNAL(debuggerStarting()), parent, SLOT(slotDebuggerStarting())); } -void DebuggerMainWndBase::setCoreFile(const QString& corefile) +void DebuggerMainWndBase::setCoreFile(const TQString& corefile) { assert(m_debugger != 0); m_debugger->useCoreFile(corefile, true); } -void DebuggerMainWndBase::setRemoteDevice(const QString& remoteDevice) +void DebuggerMainWndBase::setRemoteDevice(const TQString& remoteDevice) { if (m_debugger != 0) { m_debugger->setRemoteDevice(remoteDevice); } } -void DebuggerMainWndBase::overrideProgramArguments(const QString& args) +void DebuggerMainWndBase::overrideProgramArguments(const TQString& args) { assert(m_debugger != 0); m_debugger->overrideProgramArguments(args); } -void DebuggerMainWndBase::setTranscript(const QString& name) +void DebuggerMainWndBase::setTranscript(const TQString& name) { m_transcriptFile = name; if (m_debugger != 0 && m_debugger->driver() != 0) @@ -253,25 +253,25 @@ void DebuggerMainWndBase::restoreSettings(KConfig* config) m_headerFilter = config->readEntry(HeaderFileFilter, m_headerFilter); } -void DebuggerMainWndBase::setAttachPid(const QString& pid) +void DebuggerMainWndBase::setAttachPid(const TQString& pid) { assert(m_debugger != 0); m_debugger->setAttachPid(pid); } -bool DebuggerMainWndBase::debugProgram(const QString& executable, - QString lang, QWidget* parent) +bool DebuggerMainWndBase::debugProgram(const TQString& executable, + TQString lang, TQWidget* parent) { assert(m_debugger != 0); - TRACE(QString("trying language '%1'...").arg(lang)); + TRACE(TQString("trying language '%1'...").arg(lang)); DebuggerDriver* driver = driverFromLang(lang); if (driver == 0) { // see if there is a language in the per-program config file - QString configName = m_debugger->getConfigForExe(executable); - if (QFile::exists(configName)) + TQString configName = m_debugger->getConfigForExe(executable); + if (TQFile::exists(configName)) { KSimpleConfig c(configName, true); // read-only c.setGroup(GeneralGroup); @@ -282,23 +282,23 @@ bool DebuggerMainWndBase::debugProgram(const QString& executable, // that had only the GDB driver. lang = c.readEntry(KDebugger::DriverNameEntry, "GDB"); - TRACE(QString("...bad, trying config driver %1...").arg(lang)); + TRACE(TQString("...bad, trying config driver %1...").arg(lang)); driver = driverFromLang(lang); } } if (driver == 0) { - QString name = driverNameFromFile(executable); + TQString name = driverNameFromFile(executable); - TRACE(QString("...no luck, trying %1 derived" + TRACE(TQString("...no luck, trying %1 derived" " from file contents").arg(name)); driver = driverFromLang(name); } if (driver == 0) { // oops - QString msg = i18n("Don't know how to debug language `%1'"); + TQString msg = i18n("Don't know how to debug language `%1'"); KMessageBox::sorry(parent, msg.arg(lang)); return false; } @@ -311,7 +311,7 @@ bool DebuggerMainWndBase::debugProgram(const QString& executable, { delete driver; - QString msg = i18n("Could not start the debugger process.\n" + TQString msg = i18n("Could not start the debugger process.\n" "Please shut down KDbg and resolve the problem."); KMessageBox::sorry(parent, msg); } @@ -320,7 +320,7 @@ bool DebuggerMainWndBase::debugProgram(const QString& executable, } // derive driver from language -DebuggerDriver* DebuggerMainWndBase::driverFromLang(QString lang) +DebuggerDriver* DebuggerMainWndBase::driverFromLang(TQString lang) { // lang is needed in all lowercase lang = lang.lower(); @@ -352,7 +352,7 @@ DebuggerDriver* DebuggerMainWndBase::driverFromLang(QString lang) continue; // lang must not be longer than the full name, and it must match - if (QString(l.full).startsWith(lang)) + if (TQString(l.full).startsWith(lang)) { driverID = l.driver; break; @@ -380,7 +380,7 @@ DebuggerDriver* DebuggerMainWndBase::driverFromLang(QString lang) /** * Try to guess the language to use from the contents of the file. */ -QString DebuggerMainWndBase::driverNameFromFile(const QString& exe) +TQString DebuggerMainWndBase::driverNameFromFile(const TQString& exe) { /* Inprecise but simple test to see if file is in XSLT language */ if (exe.right(4).lower() == ".xsl") @@ -390,16 +390,16 @@ QString DebuggerMainWndBase::driverNameFromFile(const QString& exe) } // helper that gets a file name (it only differs in the caption of the dialog) -QString DebuggerMainWndBase::myGetFileName(QString caption, - QString dir, QString filter, - QWidget* parent) +TQString DebuggerMainWndBase::myGetFileName(TQString caption, + TQString dir, TQString filter, + TQWidget* parent) { - QString filename; + TQString filename; KFileDialog dlg(dir, filter, parent, "filedialog", true); dlg.setCaption(caption); - if (dlg.exec() == QDialog::Accepted) + if (dlg.exec() == TQDialog::Accepted) filename = dlg.selectedFile(); return filename; @@ -407,14 +407,14 @@ QString DebuggerMainWndBase::myGetFileName(QString caption, void DebuggerMainWndBase::newStatusMsg(KStatusBar* statusbar) { - QString msg = m_debugger->statusMessage(); + TQString msg = m_debugger->statusMessage(); statusbar->changeItem(msg, ID_STATUS_MSG); } -void DebuggerMainWndBase::doGlobalOptions(QWidget* parent) +void DebuggerMainWndBase::doGlobalOptions(TQWidget* parent) { - QTabDialog dlg(parent, "global_options", true); - QString title = kapp->caption(); + TQTabDialog dlg(parent, "global_options", true); + TQString title = kapp->caption(); title += i18n(": Global options"); dlg.setCaption(title); dlg.setCancelButton(i18n("Cancel")); @@ -434,7 +434,7 @@ void DebuggerMainWndBase::doGlobalOptions(QWidget* parent) dlg.addTab(&prefDebugger, i18n("&Debugger")); dlg.addTab(&prefMisc, i18n("&Miscellaneous")); - if (dlg.exec() == QDialog::Accepted) + if (dlg.exec() == TQDialog::Accepted) { setDebuggerCmdStr(prefDebugger.debuggerCmd()); setTerminalCmd(prefDebugger.terminal()); @@ -457,25 +457,25 @@ const char fifoNameBase[] = "/tmp/kdbgttywin%05d"; * accidentally use the wrong close() function (I've been bitten ;-), * outch!) (We use it for all the libc functions, to be consistent...) */ -QString DebuggerMainWndBase::createOutputWindow() +TQString DebuggerMainWndBase::createOutputWindow() { // create a name for a fifo - QString fifoName; + TQString fifoName; fifoName.sprintf(fifoNameBase, ::getpid()); // create a fifo that will pass in the tty name - QFile::remove(fifoName); // remove remnants + TQFile::remove(fifoName); // remove remnants #ifdef HAVE_MKFIFO if (::mkfifo(fifoName.local8Bit(), S_IRUSR|S_IWUSR) < 0) { // failed TRACE("mkfifo " + fifoName + " failed"); - return QString(); + return TQString(); } #else if (::mknod(fifoName.local8Bit(), S_IFIFO | S_IRUSR|S_IWUSR, 0) < 0) { // failed TRACE("mknod " + fifoName + " failed"); - return QString(); + return TQString(); } #endif @@ -492,7 +492,7 @@ QString DebuggerMainWndBase::createOutputWindow() "exec<&-;exec>&-;" /* close stdin and stdout */ "while :;do sleep 3600;done"; // let config file override this script - QString shellScript; + TQString shellScript; if (!m_outputTermKeepScript.isEmpty()) { shellScript = m_outputTermKeepScript; } else { @@ -502,26 +502,26 @@ QString DebuggerMainWndBase::createOutputWindow() shellScript.replace("%s", fifoName); TRACE("output window script is " + shellScript); - QString title = kapp->caption(); + TQString title = kapp->caption(); title += i18n(": Program output"); // parse the command line specified in the preferences - QStringList cmdParts = QStringList::split(' ', m_outputTermCmdStr); + TQStringList cmdParts = TQStringList::split(' ', m_outputTermCmdStr); /* * Build the argv array. Thereby substitute special sequences: */ struct { char seq[4]; - QString replace; + TQString replace; } substitute[] = { { "%T", title }, { "%C", shellScript } }; - for (QStringList::iterator i = cmdParts.begin(); i != cmdParts.end(); ++i) + for (TQStringList::iterator i = cmdParts.begin(); i != cmdParts.end(); ++i) { - QString& str = *i; + TQString& str = *i; for (int j = sizeof(substitute)/sizeof(substitute[0])-1; j >= 0; j--) { int pos = str.find(substitute[j].seq); if (pos >= 0) { @@ -536,14 +536,14 @@ QString DebuggerMainWndBase::createOutputWindow() if (m_outputTermProc->start()) { - QString tty; + TQString tty; // read the ttyname from the fifo - QFile f(fifoName); + TQFile f(fifoName); if (f.open(IO_ReadOnly)) { - QByteArray t = f.readAll(); - tty = QString::fromLocal8Bit(t, t.size()); + TQByteArray t = f.readAll(); + tty = TQString::fromLocal8Bit(t, t.size()); f.close(); } f.remove(); @@ -557,9 +557,9 @@ QString DebuggerMainWndBase::createOutputWindow() { // error, could not start xterm TRACE("fork failed for fifo " + fifoName); - QFile::remove(fifoName); + TQFile::remove(fifoName); shutdownTermWindow(); - return QString(); + return TQString(); } } @@ -569,7 +569,7 @@ void DebuggerMainWndBase::shutdownTermWindow() m_outputTermProc = 0; } -void DebuggerMainWndBase::setTerminalCmd(const QString& cmd) +void DebuggerMainWndBase::setTerminalCmd(const TQString& cmd) { m_outputTermCmdStr = cmd; // revert to default if empty @@ -604,7 +604,7 @@ void DebuggerMainWndBase::slotDebuggerStarting() m_ttyLevel = m_debugger->ttyLevel(); - QString ttyName; + TQString ttyName; switch (m_ttyLevel) { case KDebugger::ttySimpleOutputOnly: ttyName = ttyWindow()->activate(); @@ -624,12 +624,12 @@ void DebuggerMainWndBase::slotDebuggerStarting() } } -void DebuggerMainWndBase::setDebuggerCmdStr(const QString& cmd) +void DebuggerMainWndBase::setDebuggerCmdStr(const TQString& cmd) { m_debuggerCmdStr = cmd; // make empty if it is the default if (m_debuggerCmdStr == GdbDriver::defaultGdb()) { - m_debuggerCmdStr = QString(); + m_debuggerCmdStr = TQString(); } } |