-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 21 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.h | 0 | ||||
-rw-r--r-- | noncore/apps/keyz-cfg/zkb.cpp | 3 |
3 files changed, 17 insertions, 7 deletions
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp index 38bfba9..8499500 100644 --- a/noncore/applets/zkbapplet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/zkbwidget.cpp @@ -1,2 +1,3 @@ #include <opie2/otaskbarapplet.h> +#include <opie2/okeyfilter.h> #include <qpe/qcopenvelope_qws.h> @@ -11,4 +12,5 @@ using namespace Opie::Ui; -ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), - disabled(Resource::loadPixmap("zkb-disabled")) { + +ZkbWidget::ZkbWidget(QWidget* parent) + :QLabel(parent),keymap(0),disabled(Resource::loadPixmap("zkb-disabled")) { @@ -27,3 +29,8 @@ ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), -ZkbWidget::~ZkbWidget() { +ZkbWidget::~ZkbWidget() +{ + if (keymap != 0) { + delete keymap; + keymap = 0; + } } @@ -55,3 +62,3 @@ bool ZkbWidget::loadKeymap() { - qwsServer->setKeyboardFilter(km); + Opie::Core::OKeyFilter::inst()->addHandler(km); @@ -64,3 +71,5 @@ bool ZkbWidget::loadKeymap() { - setText(keymap->getCurrentLabel()); + QString ltext = keymap->getCurrentLabel(); + if (ltext.length()==0) ltext = "??"; + setText(ltext); @@ -159,3 +168 @@ void ZkbWidget::reload() { EXPORT_OPIE_APPLET_v1( ZkbWidget ) - - diff --git a/noncore/applets/zkbapplet/zkbwidget.h b/noncore/applets/zkbapplet/zkbwidget.h index 7c67794..9bce85a 100644 --- a/noncore/applets/zkbapplet/zkbwidget.h +++ b/noncore/applets/zkbapplet/zkbwidget.h diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp index c9e1dc5..a357b88 100644 --- a/noncore/apps/keyz-cfg/zkb.cpp +++ b/noncore/apps/keyz-cfg/zkb.cpp @@ -4,2 +4,3 @@ #include <opie2/odebug.h> +#include <opie2/okeyfilter.h> @@ -248,2 +249,4 @@ Keymap::Keymap():enabled(true), currentState(0), autoRepeatAction(0), repeater(t Keymap::~Keymap() { + odebug << "removing keyboard filter for zkb"<<oendl; + Opie::Core::OKeyFilter::inst()->remHandler(this); QMap<QString, State*>::Iterator it; |