Diffstat (limited to 'noncore/applets/zkbapplet/keyzcfg') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp | 2 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/keyzcfg/main.cpp | 4 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/keyzcfg/zkbcfg.cpp | 19 |
3 files changed, 18 insertions, 7 deletions
diff --git a/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp b/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp index 4190a9e..6f24ea0 100644 --- a/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/cfgdlg.cpp | |||
@@ -124,7 +124,7 @@ void CfgDlg::accept() { | |||
124 | cfile->setAutorepeatPeriod(ap->value()); | 124 | cfile->setAutorepeatPeriod(ap->value()); |
125 | 125 | ||
126 | CfgParser p; | 126 | CfgParser p; |
127 | p.save(QPEApplication::qpeDir()+"share/zkb/zkb.xml", *cfile); | 127 | p.save(Global::applicationFileName("zkb", "zkb.xml" ), *cfile); |
128 | QCopEnvelope("QPE/zkb", "reload()"); | 128 | QCopEnvelope("QPE/zkb", "reload()"); |
129 | 129 | ||
130 | QDialog::accept(); | 130 | QDialog::accept(); |
diff --git a/noncore/applets/zkbapplet/keyzcfg/main.cpp b/noncore/applets/zkbapplet/keyzcfg/main.cpp index afd0f6a..d7926f0 100644 --- a/noncore/applets/zkbapplet/keyzcfg/main.cpp +++ b/noncore/applets/zkbapplet/keyzcfg/main.cpp | |||
@@ -1,5 +1,7 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qpe/global.h> | ||
4 | |||
3 | #include <qlayout.h> | 5 | #include <qlayout.h> |
4 | #include <qmainwindow.h> | 6 | #include <qmainwindow.h> |
5 | 7 | ||
@@ -9,7 +11,7 @@ int main( int argc, char **argv ) { | |||
9 | QPEApplication app(argc, argv); | 11 | QPEApplication app(argc, argv); |
10 | CfgFile cfile; | 12 | CfgFile cfile; |
11 | CfgParser cp; | 13 | CfgParser cp; |
12 | cp.load(QPEApplication::qpeDir()+"share/zkb/zkb.xml", cfile); | 14 | cp.load(Global::applicationFileName("zkb", "zkb.xml"), cfile); |
13 | 15 | ||
14 | 16 | ||
15 | CfgDlg c(0, &cfile, &app, true); | 17 | CfgDlg c(0, &cfile, &app, true); |
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 | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | /* OPIE */ | 3 | /* OPIE */ |
4 | #include <opie2/odebug.h> | 4 | #include <opie2/odebug.h> |
5 | #include <opie2/oapplication.h> | ||
5 | using namespace Opie::Core; | 6 | using namespace Opie::Core; |
6 | 7 | ||
7 | /* QT */ | 8 | /* QT */ |
@@ -16,16 +17,23 @@ ZkbConfig::~ZkbConfig() { | |||
16 | 17 | ||
17 | bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { | 18 | bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { |
18 | bool ret; | 19 | bool ret; |
19 | QFile f(path+"/"+file); | 20 | QFile *f = new QFile(path+"/"+file); |
20 | QFileInfo fi(f); | 21 | QFileInfo fi(*f); |
21 | 22 | ||
22 | odebug << "start loading file=" << file.utf8() << "\n" << oendl; | 23 | /* Try */ |
24 | if ( !fi.exists() && !path.contains( QPEApplication::qpeDir()) ) { | ||
25 | delete f; | ||
26 | f = new QFile( QPEApplication::qpeDir() + "share/zkb/" + file ); | ||
27 | fi = QFileInfo( *f ); | ||
28 | } | ||
29 | |||
30 | odebug << "start loading file=" << file << "\n" << oendl; | ||
23 | if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { | 31 | if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { |
24 | return false; | 32 | return false; |
25 | } | 33 | } |
26 | 34 | ||
27 | includedFiles.insert(fi.absFilePath(), 1); | 35 | includedFiles.insert(fi.absFilePath(), 1); |
28 | QXmlInputSource is(f); | 36 | QXmlInputSource is(*f); |
29 | QXmlSimpleReader reader; | 37 | QXmlSimpleReader reader; |
30 | ZkbHandler h(*this, keymap, prefix); | 38 | ZkbHandler h(*this, keymap, prefix); |
31 | 39 | ||
@@ -34,7 +42,8 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) | |||
34 | ret = reader.parse(is); | 42 | ret = reader.parse(is); |
35 | includedFiles.remove(fi.absFilePath()); | 43 | includedFiles.remove(fi.absFilePath()); |
36 | 44 | ||
37 | odebug << "end loading file=" << file.utf8() << ": status=" << err.utf8() << oendl; | 45 | odebug << "end loading file=" << file << ": status=" << err << oendl; |
46 | delete f; | ||
38 | return ret; | 47 | return ret; |
39 | } | 48 | } |
40 | 49 | ||