author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/keyz-cfg/cfgfile.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/apps/keyz-cfg/cfgfile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/keyz-cfg/cfgfile.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/noncore/apps/keyz-cfg/cfgfile.cpp b/noncore/apps/keyz-cfg/cfgfile.cpp index b0dc968..81d1ee1 100644 --- a/noncore/apps/keyz-cfg/cfgfile.cpp +++ b/noncore/apps/keyz-cfg/cfgfile.cpp @@ -1,27 +1,33 @@ -#include <qmessagebox.h> #include "cfgfile.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qmessagebox.h> + // CfgEntry implementation CfgEntry::CfgEntry() { } CfgEntry::CfgEntry(const QString& f, const QString& l): file(f), label(l) { } const QString& CfgEntry::getFile() const { return file; } void CfgEntry::setFile(const QString& f) { file = f; } const QString& CfgEntry::getLabel() const { return label; } void CfgEntry::setLabel(const QString& f) { label = f; } @@ -74,60 +80,60 @@ int CfgFile::getAutorepeatPeriod() const { void CfgFile::setAutorepeatPeriod(int n) { arperiod = n; } // CfgParser implementation CfgParser::CfgParser() { } bool CfgParser::load(QString file, CfgFile& cfg) { QFile f(file); QXmlInputSource is(f); QXmlSimpleReader reader; CfgHandler p(*this); reader.setErrorHandler(this); reader.setContentHandler(&p); err = ""; ardelay = -1; arperiod = -1; reader.parse(is); if (!err.isEmpty()) { - qDebug(err); + odebug << err << oendl; return false; } QMap<QString, QString>::Iterator fit, lit; for(uint i = 0; i < includeList.count(); i++) { QString file = *includeList.at(i); fit = includes.find(file); QString prefix = fit.data(); QString label = ""; - qDebug("include: file=" + fit.key() + ", prefix=" + fit.data()); + odebug << "include: file=" + fit.key() + ", prefix=" + fit.data() << oendl; lit = labels.find(prefix+":*"); if (lit != labels.end()) { label = lit.data(); } cfg.replaceEntry(file, label); } if (ardelay != -1) { cfg.setAutorepeatDelay(ardelay); } if (arperiod != -1) { cfg.setAutorepeatPeriod(arperiod); } return true; } bool CfgParser::save(QString file, CfgFile& cfg) { FILE* f = fopen((const char*) file.local8Bit(), "w"); fprintf(f, "<keymap autorepeat-delay=\"%d\" autorepeat-period=\"%d\" " "author=\"keyzcfg\">\n", cfg.getAutorepeatDelay(), |