-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelper.cpp | 2 | ||||
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/config/KeycfgReader.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelper.cpp b/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelper.cpp index 4afdc1f..4723699 100644 --- a/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelper.cpp +++ b/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelper.cpp @@ -1,48 +1,50 @@ #include "KeyHelper.h" #include <opie2/okeyfilter.h> +#include <opie2/odebug.h> KeyHelper::KeyHelper() { qDebug("KeyHelper::KeyHelper()"); load(); m_oAction.setKeyModifiers(&m_oModifiers); m_oAction.setKeyMappings(&m_oMappings); m_oAction.setKeyExtensions(&m_oExtensions); m_oAction.setKeyRepeater(&m_oRepeater); m_oExtensions.setKeyModifiers(&m_oModifiers); } KeyHelper::~KeyHelper() { unset(); qDebug("KeyHelper::~KeyHelper()"); } bool KeyHelper::filter(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat) { + odebug << "KeyHelper <<< "<<unicode<<" - "<<keycode<<" - "<<modifiers<<"\n"; m_oAction.setAction(unicode, keycode, modifiers, isPress, autoRepeat); return(m_oAction.doAction()); } void KeyHelper::unset() { Opie::Core::OKeyFilter::inst()->remHandler(this);; } void KeyHelper::set() { Opie::Core::OKeyFilter::inst()->addHandler(this); m_oModifiers.resetStates(); } void KeyHelper::enable() { m_oAction.enable(); } void KeyHelper::disable() { m_oAction.disable(); diff --git a/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgReader.cpp b/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgReader.cpp index 44b4b2f..14e8a37 100644 --- a/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgReader.cpp +++ b/noncore/applets/keyhelper/keyhelperapplet/config/KeycfgReader.cpp @@ -1,47 +1,47 @@ #include "KeycfgReader.h" KeycfgReader::KeycfgReader() { qDebug("KeycfgReader::KeycfgReader()"); } KeycfgReader::~KeycfgReader() { qDebug("KeycfgReader::~KeycfgReader()"); } bool KeycfgReader::load() { QString file; ConfigEx& cfg = ConfigEx::getInstance("keyhelper"); cfg.setGroup("Global"); file = cfg.readEntry("XmlFile"); if(file.length() == 0 || !QFile::exists(file)){ /* default */ - file = QDir::homeDirPath() + "/Settings/keyhelper.xml"; + file = QString(getenv( "HOME" )) + QString("/Settings/keyhelper.xml"); } return(load(file)); } bool KeycfgReader::load(const QString& path) { bool success = false; KeyNames::reset(); QXmlSimpleReader parser; KeycfgHandler handler(&parser); KeycfgErrorHandler errhandler; QFile file(path); qWarning("KeycfgReader::load()[%s]", path.latin1()); if(file.exists()){ QXmlInputSource source(file); handler.setKeyModifiers(m_pModifiers); handler.setKeyMappings(m_pMappings); handler.setKeyExtensions(m_pExtensions); handler.setKeyRepeater(m_pRepeater); |