summaryrefslogtreecommitdiff
path: root/noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp
Side-by-side diff
Diffstat (limited to 'noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp b/noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp
index 24bd897..6f3b9bf 100644
--- a/noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp
+++ b/noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp
@@ -4,2 +4,3 @@
#include <opie2/odebug.h>
+#include <opie2/oapplication.h>
using namespace Opie::Core;
@@ -18,6 +19,13 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix)
bool ret;
- QFile f(path+"/"+file);
- QFileInfo fi(f);
+ QFile *f = new QFile(path+"/"+file);
+ QFileInfo fi(*f);
- odebug << "start loading file=" << file.utf8() << "\n" << oendl;
+ /* Try */
+ if ( !fi.exists() && !path.contains( QPEApplication::qpeDir()) ) {
+ delete f;
+ f = new QFile( QPEApplication::qpeDir() + "share/zkb/" + file );
+ fi = QFileInfo( *f );
+ }
+
+ odebug << "start loading file=" << file << "\n" << oendl;
if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) {
@@ -27,3 +35,3 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix)
includedFiles.insert(fi.absFilePath(), 1);
- QXmlInputSource is(f);
+ QXmlInputSource is(*f);
QXmlSimpleReader reader;
@@ -36,3 +44,4 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix)
- odebug << "end loading file=" << file.utf8() << ": status=" << err.utf8() << oendl;
+ odebug << "end loading file=" << file << ": status=" << err << oendl;
+ delete f;
return ret;