author | zautrix <zautrix> | 2004-10-23 09:04:58 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-23 09:04:58 (UTC) |
commit | ba2583db0431059cd7368be23c9653e81af16d29 (patch) (unidiff) | |
tree | 75d4a662731651d391a5e5bb60e89d1245781593 /pwmanager | |
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 | |||
@@ -21,12 +21,14 @@ | |||
21 | #include <klistview.h> | 21 | #include <klistview.h> |
22 | #include <ktoolbar.h> | 22 | #include <ktoolbar.h> |
23 | #include <kfiledialog.h> | 23 | #include <kfiledialog.h> |
24 | #include <kiconloader.h> | 24 | #include <kiconloader.h> |
25 | #include <kmessagebox.h> | 25 | #include <kmessagebox.h> |
26 | 26 | ||
27 | #include <qstatusbar.h> | ||
28 | |||
27 | #ifndef PWM_EMBEDDED | 29 | #ifndef PWM_EMBEDDED |
28 | #include <kmenubar.h> | 30 | #include <kmenubar.h> |
29 | #include <kstatusbar.h> | 31 | #include <kstatusbar.h> |
30 | #include <dcopclient.h> | 32 | #include <dcopclient.h> |
31 | #include "configwndimpl.h" | 33 | #include "configwndimpl.h" |
32 | #include "configuration.h" | 34 | #include "configuration.h" |
@@ -1355,23 +1357,21 @@ void PwM::copyToClipboard(const QString &s) | |||
1355 | cb->setText(s); | 1357 | cb->setText(s); |
1356 | 1358 | ||
1357 | #endif | 1359 | #endif |
1358 | 1360 | ||
1359 | } | 1361 | } |
1360 | 1362 | ||
1363 | |||
1361 | void PwM::showStatMsg(const QString &msg) | 1364 | void PwM::showStatMsg(const QString &msg) |
1362 | { | 1365 | { |
1363 | #ifndef PWM_EMBEDDED | 1366 | #ifdef DESKTOP_VERSION |
1364 | KStatusBar *statBar = statusBar(); | 1367 | statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); |
1365 | statBar->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); | ||
1366 | #else | 1368 | #else |
1367 | qDebug("Statusbar : %s",msg.latin1()); | 1369 | qDebug("Statusbar : %s",msg.latin1()); |
1368 | #ifndef DESKTOP_VERSION | ||
1369 | Global::statusMessage(msg); | 1370 | Global::statusMessage(msg); |
1370 | #endif | 1371 | #endif |
1371 | #endif | ||
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | void PwM::focusInEvent(QFocusEvent *e) | 1374 | void PwM::focusInEvent(QFocusEvent *e) |
1375 | { | 1375 | { |
1376 | if (e->gotFocus()) { | 1376 | if (e->gotFocus()) { |
1377 | emit gotFocus(this); | 1377 | emit gotFocus(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 | |||
@@ -376,28 +376,28 @@ bool PwMDocUi::openDocUi(PwMDoc *doc, | |||
376 | if (ret != e_success) { | 376 | if (ret != e_success) { |
377 | if (ret == e_readFile || ret == e_openFile) { | 377 | if (ret == e_readFile || ret == e_openFile) { |
378 | KMessageBox::error(getCurrentView(), | 378 | KMessageBox::error(getCurrentView(), |
379 | i18n("Could not read file!") | 379 | i18n("Could not read file!") |
380 | + "\n" | 380 | + "\n" |
381 | + filename, | 381 | + filename, |
382 | i18n("file error")); | 382 | i18n("File error")); |
383 | goto cancelOpen; | 383 | goto cancelOpen; |
384 | } | 384 | } |
385 | if (ret == e_alreadyOpen) { | 385 | if (ret == e_alreadyOpen) { |
386 | KMessageBox::error(getCurrentView(), | 386 | KMessageBox::error(getCurrentView(), |
387 | i18n("This file is already open."), | 387 | i18n("This file is already open."), |
388 | i18n("already open")); | 388 | i18n("Already open")); |
389 | goto cancelOpen; | 389 | goto cancelOpen; |
390 | } | 390 | } |
391 | if (ret == e_fileVer) { | 391 | if (ret == e_fileVer) { |
392 | KMessageBox::error(getCurrentView(), | 392 | KMessageBox::error(getCurrentView(), |
393 | i18n | 393 | i18n |
394 | ("File-version is not supported!\n" | 394 | ("File-version is not supported!\n" |
395 | "Did you create this file with an\nolder or newer version of PwM?"), | 395 | "Did you create this file with an\nolder or newer version of PwM?"), |
396 | i18n | 396 | i18n |
397 | ("incompatible version")); | 397 | ("Incompatible version")); |
398 | goto cancelOpen; | 398 | goto cancelOpen; |
399 | } | 399 | } |
400 | if (ret == e_wrongPw) { | 400 | if (ret == e_wrongPw) { |
401 | continue; | 401 | continue; |
402 | } | 402 | } |
403 | if (ret == e_noPw) { | 403 | if (ret == e_noPw) { |
@@ -407,23 +407,23 @@ bool PwMDocUi::openDocUi(PwMDoc *doc, | |||
407 | KMessageBox::error(getCurrentView(), | 407 | KMessageBox::error(getCurrentView(), |
408 | i18n | 408 | i18n |
409 | ("Sorry, this file has not been recognized\n" | 409 | ("Sorry, this file has not been recognized\n" |
410 | "as a PwM Password file.\n" | 410 | "as a PwM Password file.\n" |
411 | "Probably you have selected the wrong file."), | 411 | "Probably you have selected the wrong file."), |
412 | i18n | 412 | i18n |
413 | ("no PwM password-file")); | 413 | ("No PwM password-file")); |
414 | goto cancelOpen; | 414 | goto cancelOpen; |
415 | } | 415 | } |
416 | if (ret == e_fileCorrupt) { | 416 | if (ret == e_fileCorrupt) { |
417 | KMessageBox::error(getCurrentView(), | 417 | KMessageBox::error(getCurrentView(), |
418 | i18n | 418 | i18n |
419 | ("File corrupt!\n" | 419 | ("File corrupt!\n" |
420 | "Maybe the media, you stored this file on,\n" | 420 | "Maybe the media, you stored this file on,\n" |
421 | "had bad sectors?"), | 421 | "had bad sectors?"), |
422 | i18n | 422 | i18n |
423 | ("checksum error")); | 423 | ("Checksum error")); |
424 | goto cancelOpen; | 424 | goto cancelOpen; |
425 | } | 425 | } |
426 | } | 426 | } |
427 | break; | 427 | break; |
428 | } | 428 | } |
429 | return true; | 429 | return true; |
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 | |||
@@ -162,12 +162,14 @@ void Serializer::clear() | |||
162 | delete_ifnot_null(domDoc); | 162 | delete_ifnot_null(domDoc); |
163 | domDoc = new QDomDocument; | 163 | domDoc = new QDomDocument; |
164 | } | 164 | } |
165 | 165 | ||
166 | bool Serializer::parseXml(const QCString &buffer) | 166 | bool Serializer::parseXml(const QCString &buffer) |
167 | { | 167 | { |
168 | //abort(); | ||
169 | //qDebug("parse %s ", buffer.data()); | ||
168 | PWM_ASSERT(domDoc); | 170 | PWM_ASSERT(domDoc); |
169 | #ifndef PWM_EMBEDDED | 171 | #ifndef PWM_EMBEDDED |
170 | if (!domDoc->setContent(buffer, true)) | 172 | if (!domDoc->setContent(buffer, true)) |
171 | return false; | 173 | return false; |
172 | #else | 174 | #else |
173 | #ifdef DESKTOP_VERSION | 175 | #ifdef DESKTOP_VERSION |
@@ -353,12 +355,13 @@ bool Serializer::extractEntry(const QDomNode &n, | |||
353 | } else { | 355 | } else { |
354 | printDebug("Serializer::extractEntry(): neither CDATA nor element."); | 356 | printDebug("Serializer::extractEntry(): neither CDATA nor element."); |
355 | return false; | 357 | return false; |
356 | } | 358 | } |
357 | if (text == " ") | 359 | if (text == " ") |
358 | text = ""; // for backward compatibility. | 360 | text = ""; // for backward compatibility. |
361 | //qDebug("entry %s ",unescapeEntryData(text).latin1()); | ||
359 | if (name == ENTRY_DESC_NEW || | 362 | if (name == ENTRY_DESC_NEW || |
360 | name == ENTRY_DESC_OLD) { | 363 | name == ENTRY_DESC_OLD) { |
361 | dta->desc = unescapeEntryData(text).latin1(); | 364 | dta->desc = unescapeEntryData(text).latin1(); |
362 | } else if (name == ENTRY_NAME_NEW || | 365 | } else if (name == ENTRY_NAME_NEW || |
363 | name == ENTRY_NAME_OLD) { | 366 | name == ENTRY_NAME_OLD) { |
364 | dta->name = unescapeEntryData(text).latin1(); | 367 | dta->name = unescapeEntryData(text).latin1(); |
@@ -698,15 +701,20 @@ QString Serializer::escapeEntryData(QString dta) | |||
698 | QString Serializer::unescapeEntryData(QString dta) | 701 | QString Serializer::unescapeEntryData(QString dta) |
699 | { | 702 | { |
700 | #ifndef PWM_EMBEDDED | 703 | #ifndef PWM_EMBEDDED |
701 | dta.replace("$>--endl--<$", "\n"); | 704 | dta.replace("$>--endl--<$", "\n"); |
702 | dta.replace("||>", "]]>"); | 705 | dta.replace("||>", "]]>"); |
703 | #else | 706 | #else |
707 | #ifdef DESKTOP_VERSION | ||
708 | dta.replace("$>--endl--<$", "\n"); | ||
709 | dta.replace("||>", "]]>"); | ||
710 | #else | ||
704 | dta.replace(QRegExp("\\$>--endl--<\\$"), "\n"); | 711 | dta.replace(QRegExp("\\$>--endl--<\\$"), "\n"); |
705 | dta.replace(QRegExp("||>"), "]]>"); | 712 | dta.replace(QRegExp("||>"), "]]>"); |
706 | #endif | 713 | #endif |
714 | #endif | ||
707 | return dta; | 715 | return dta; |
708 | } | 716 | } |
709 | 717 | ||
710 | 718 | ||
711 | //US ENH: the following methods are getting used to write/read sync entries | 719 | //US ENH: the following methods are getting used to write/read sync entries |
712 | /** read the syncentries in the node "n" */ | 720 | /** read the syncentries in the node "n" */ |