author | zautrix <zautrix> | 2004-10-23 09:04:58 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-23 09:04:58 (UTC) |
commit | ba2583db0431059cd7368be23c9653e81af16d29 (patch) (side-by-side diff) | |
tree | 75d4a662731651d391a5e5bb60e89d1245781593 | |
parent | eb0bc46bfbba45a84c7353f1c9c4dba27273f021 (diff) | |
download | kdepimpi-ba2583db0431059cd7368be23c9653e81af16d29.zip kdepimpi-ba2583db0431059cd7368be23c9653e81af16d29.tar.gz kdepimpi-ba2583db0431059cd7368be23c9653e81af16d29.tar.bz2 |
fixed desktop descape bug. added statusbar to embedded and desktop
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 10 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdocui.cpp | 10 | ||||
-rw-r--r-- | pwmanager/pwmanager/serializer.cpp | 8 |
3 files changed, 18 insertions, 10 deletions
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 9798e8e..b7b5307 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp @@ -19,16 +19,18 @@ #include <klocale.h> #include <klistview.h> #include <ktoolbar.h> #include <kfiledialog.h> #include <kiconloader.h> #include <kmessagebox.h> +#include <qstatusbar.h> + #ifndef PWM_EMBEDDED #include <kmenubar.h> #include <kstatusbar.h> #include <dcopclient.h> #include "configwndimpl.h" #include "configuration.h" #else #include <qmenubar.h> @@ -1353,27 +1355,25 @@ void PwM::copyToClipboard(const QString &s) cb->setText(s, QClipboard::Clipboard); #else cb->setText(s); #endif } + void PwM::showStatMsg(const QString &msg) { -#ifndef PWM_EMBEDDED - KStatusBar *statBar = statusBar(); - statBar->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); +#ifdef DESKTOP_VERSION + statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); #else qDebug("Statusbar : %s",msg.latin1()); -#ifndef DESKTOP_VERSION Global::statusMessage(msg); #endif -#endif } void PwM::focusInEvent(QFocusEvent *e) { if (e->gotFocus()) { emit gotFocus(this); } else if (e->lostFocus()) { emit lostFocus(this); diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp index 6ddb6f5..71b4a8d 100644 --- a/pwmanager/pwmanager/pwmdocui.cpp +++ b/pwmanager/pwmanager/pwmdocui.cpp @@ -374,58 +374,58 @@ bool PwMDocUi::openDocUi(PwMDoc *doc, ret = doc->openDoc(&filename, lockStat); //qDebug("pwmdocui::OpenDocui %i", ret); if (ret != e_success) { if (ret == e_readFile || ret == e_openFile) { KMessageBox::error(getCurrentView(), i18n("Could not read file!") + "\n" + filename, - i18n("file error")); + i18n("File error")); goto cancelOpen; } if (ret == e_alreadyOpen) { KMessageBox::error(getCurrentView(), i18n("This file is already open."), - i18n("already open")); + i18n("Already open")); goto cancelOpen; } if (ret == e_fileVer) { KMessageBox::error(getCurrentView(), i18n ("File-version is not supported!\n" "Did you create this file with an\nolder or newer version of PwM?"), i18n - ("incompatible version")); + ("Incompatible version")); goto cancelOpen; } if (ret == e_wrongPw) { continue; } if (ret == e_noPw) { goto cancelOpen; } if (ret == e_fileFormat) { KMessageBox::error(getCurrentView(), i18n ("Sorry, this file has not been recognized\n" "as a PwM Password file.\n" "Probably you have selected the wrong file."), i18n - ("no PwM password-file")); + ("No PwM password-file")); goto cancelOpen; } if (ret == e_fileCorrupt) { KMessageBox::error(getCurrentView(), i18n ("File corrupt!\n" "Maybe the media, you stored this file on,\n" "had bad sectors?"), i18n - ("checksum error")); + ("Checksum error")); goto cancelOpen; } } break; } return true; cancelOpen: diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp index ed0f754..5753c1d 100644 --- a/pwmanager/pwmanager/serializer.cpp +++ b/pwmanager/pwmanager/serializer.cpp @@ -160,16 +160,18 @@ Serializer::~Serializer() void Serializer::clear() { delete_ifnot_null(domDoc); domDoc = new QDomDocument; } bool Serializer::parseXml(const QCString &buffer) { + //abort(); + //qDebug("parse %s ", buffer.data()); PWM_ASSERT(domDoc); #ifndef PWM_EMBEDDED if (!domDoc->setContent(buffer, true)) return false; #else #ifdef DESKTOP_VERSION if (!domDoc->setContent(buffer, true)) #else @@ -351,16 +353,17 @@ bool Serializer::extractEntry(const QDomNode &n, } else if (likely(cur.isElement())) { text = cur.toElement().text(); } else { printDebug("Serializer::extractEntry(): neither CDATA nor element."); return false; } if (text == " ") text = ""; // for backward compatibility. + //qDebug("entry %s ",unescapeEntryData(text).latin1()); if (name == ENTRY_DESC_NEW || name == ENTRY_DESC_OLD) { dta->desc = unescapeEntryData(text).latin1(); } else if (name == ENTRY_NAME_NEW || name == ENTRY_NAME_OLD) { dta->name = unescapeEntryData(text).latin1(); } else if (name == ENTRY_PW_NEW || name == ENTRY_PW_OLD) { @@ -696,19 +699,24 @@ QString Serializer::escapeEntryData(QString dta) } QString Serializer::unescapeEntryData(QString dta) { #ifndef PWM_EMBEDDED dta.replace("$>--endl--<$", "\n"); dta.replace("||>", "]]>"); #else +#ifdef DESKTOP_VERSION + dta.replace("$>--endl--<$", "\n"); + dta.replace("||>", "]]>"); +#else dta.replace(QRegExp("\\$>--endl--<\\$"), "\n"); dta.replace(QRegExp("||>"), "]]>"); #endif +#endif return dta; } //US ENH: the following methods are getting used to write/read sync entries /** read the syncentries in the node "n" */ bool Serializer::readSyncData(const QDomNode &n, vector<PwMSyncItem> *dta) { |