diff --git a/include/TEWidget.h b/include/TEWidget.h index 1b4dd715..1a4df136 100644 --- a/include/TEWidget.h +++ b/include/TEWidget.h @@ -31,6 +31,7 @@ class TEWidget : public QFrame public: TEWidget(QWidget *parent=0, const char *name=0); + virtual ~TEWidget(); public: diff --git a/src/TEWidget.C b/src/TEWidget.C index d6c1d6a7..211ddf6b 100644 --- a/src/TEWidget.C +++ b/src/TEWidget.C @@ -264,10 +264,15 @@ TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) setVTFont( QFont("fixed") ); setColorTable(base_color_table); // init color table - if ( parent ) parent->installEventFilter( this ); //FIXME: see below + qApp->installEventFilter( this ); //FIXME: see below } //FIXME: make proper destructor +// Here's a start (David) +TEWidget::~TEWidget() +{ + qApp->removeEventFilter( this ); +} /* ------------------------------------------------------------------------- */ /* */ @@ -866,7 +871,8 @@ bool TEWidget::eventFilter( QObject *, QEvent *e ) QApplication::sendEvent(scrollbar, e); } if ( e->type() == QEvent::KeyPress ) - { QKeyEvent* ke = (QKeyEvent*)e; + { + QKeyEvent* ke = (QKeyEvent*)e; actSel=0; // Key stroke implies a screen update, so TEWidget won't // know where the current selection is. diff --git a/src/konsole_part.C b/src/konsole_part.C index 55c7b734..da02cee7 100644 --- a/src/konsole_part.C +++ b/src/konsole_part.C @@ -98,7 +98,6 @@ konsolePart::konsolePart(QWidget *parent, const char *name) //bool welcome = true; bool histon = true; const char* wname = PACKAGE; - const char* shell = getenv("SHELL"); // QCString sz = ""; //sz = args->getOption("vt_sz"); @@ -108,10 +107,10 @@ konsolePart::konsolePart(QWidget *parent, const char *name) QStrList eargs; // welcome = args->isSet("welcome"); + const char* shell = getenv("SHELL"); if (shell == NULL || *shell == '\0') shell = "/bin/sh"; - // shell = "/bin/ls"; - shell = "/usr/bin/mc"; - eargs.append(shell); + //shell = "/usr/bin/mc"; + eargs.append(shell); te = new TEWidget(parent); te->setFocusPolicy(QWidget::ClickFocus); te->setMinimumSize(150,70); // allow resizing, cause resize in TEWidget @@ -128,6 +127,11 @@ konsolePart::konsolePart(QWidget *parent, const char *name) // kDebugInfo("Loading successful"); // kDebugInfo("XML file set"); + + // This is needed since only konsole.C does it + // Without those two -> crash on keypress... (David) + KeyTrans::loadAll(); + initial->getEmulation()->setKeytrans(0); }