author | ulf69 <ulf69> | 2004-10-19 18:11:34 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-19 18:11:34 (UTC) |
commit | 695c64501950e0503ed558fbe8d8c06993776eaa (patch) (unidiff) | |
tree | 6b860a9512f534ab0c4361cf3d529f57755fef71 /pwmanager | |
parent | 4f780ff70bc13bf9cb7e7c33f869a59dfcc36e69 (diff) | |
download | kdepimpi-695c64501950e0503ed558fbe8d8c06993776eaa.zip kdepimpi-695c64501950e0503ed558fbe8d8c06993776eaa.tar.gz kdepimpi-695c64501950e0503ed558fbe8d8c06993776eaa.tar.bz2 |
changed comments
-rw-r--r-- | pwmanager/pwmanager/randomizer.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/randomizer.h | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/serializer.cpp | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/serializer.h | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/pwmanager/pwmanager/randomizer.cpp b/pwmanager/pwmanager/randomizer.cpp index 1269c53..e1085ff 100644 --- a/pwmanager/pwmanager/randomizer.cpp +++ b/pwmanager/pwmanager/randomizer.cpp | |||
@@ -1,62 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 2.0 of pwmanager | 14 | * This file is originaly based on version 1.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #include "randomizer.h" | 20 | #include "randomizer.h" |
21 | #include "pwmexception.h" | 21 | #include "pwmexception.h" |
22 | 22 | ||
23 | #include <qfile.h> | 23 | #include <qfile.h> |
24 | 24 | ||
25 | #include <kapplication.h> | 25 | #include <kapplication.h> |
26 | 26 | ||
27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
28 | #include <time.h> | 28 | #include <time.h> |
29 | 29 | ||
30 | 30 | ||
31 | #ifdef PWM_EMBEDDED | 31 | #ifdef PWM_EMBEDDED |
32 | 32 | ||
33 | #ifndef Q_LONG | 33 | #ifndef Q_LONG |
34 | #define Q_LONG long | 34 | #define Q_LONG long |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #endif //PWM_EMBEDDED | 37 | #endif //PWM_EMBEDDED |
38 | 38 | ||
39 | 39 | ||
40 | Randomizer * Randomizer::rndObj (0); | 40 | Randomizer * Randomizer::rndObj (0); |
41 | 41 | ||
42 | Randomizer::Randomizer() | 42 | Randomizer::Randomizer() |
43 | { | 43 | { |
44 | rndDev = new QFile; | 44 | rndDev = new QFile; |
45 | seed = time(0); | 45 | seed = time(0); |
46 | 46 | ||
47 | #if 1 // set to 0 to test rand_r() fallback | 47 | #if 1 // set to 0 to test rand_r() fallback |
48 | 48 | ||
49 | // probe for /dev/urandom | 49 | // probe for /dev/urandom |
50 | rndDev->setName("/dev/urandom"); | 50 | rndDev->setName("/dev/urandom"); |
51 | if (rndDev->exists() && | 51 | if (rndDev->exists() && |
52 | rndDev->open(IO_ReadOnly)) { | 52 | rndDev->open(IO_ReadOnly)) { |
53 | printDebug("Randomizer: using /dev/urandom"); | 53 | printDebug("Randomizer: using /dev/urandom"); |
54 | return; | 54 | return; |
55 | } | 55 | } |
56 | 56 | ||
57 | // probe for /dev/random | 57 | // probe for /dev/random |
58 | rndDev->setName("/dev/random"); | 58 | rndDev->setName("/dev/random"); |
59 | if (rndDev->exists() && | 59 | if (rndDev->exists() && |
60 | rndDev->open(IO_ReadOnly)) { | 60 | rndDev->open(IO_ReadOnly)) { |
61 | printDebug("Randomizer: using /dev/random"); | 61 | printDebug("Randomizer: using /dev/random"); |
62 | return; | 62 | return; |
diff --git a/pwmanager/pwmanager/randomizer.h b/pwmanager/pwmanager/randomizer.h index 5eb02f1..f2a6015 100644 --- a/pwmanager/pwmanager/randomizer.h +++ b/pwmanager/pwmanager/randomizer.h | |||
@@ -1,62 +1,62 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 2.0 of pwmanager | 14 | * This file is originaly based on version 1.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #ifndef __RANDOMIZER_H | 20 | #ifndef __RANDOMIZER_H |
21 | #define __RANDOMIZER_H | 21 | #define __RANDOMIZER_H |
22 | 22 | ||
23 | #include "pwmexception.h" | 23 | #include "pwmexception.h" |
24 | 24 | ||
25 | #ifndef PWM_EMBEDDED | 25 | #ifndef PWM_EMBEDDED |
26 | #include <qmutex.h> | 26 | #include <qmutex.h> |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | #include <string> | 29 | #include <string> |
30 | 30 | ||
31 | using std::string; | 31 | using std::string; |
32 | 32 | ||
33 | class QFile; | 33 | class QFile; |
34 | 34 | ||
35 | /** Randomizer to get random values. | 35 | /** Randomizer to get random values. |
36 | * This class is thread-safe. | 36 | * This class is thread-safe. |
37 | * You should always use the instance returned by | 37 | * You should always use the instance returned by |
38 | * obj() to use it. | 38 | * obj() to use it. |
39 | */ | 39 | */ |
40 | class Randomizer | 40 | class Randomizer |
41 | { | 41 | { |
42 | public: | 42 | public: |
43 | Randomizer(); | 43 | Randomizer(); |
44 | ~Randomizer(); | 44 | ~Randomizer(); |
45 | 45 | ||
46 | static Randomizer * obj() | 46 | static Randomizer * obj() |
47 | { | 47 | { |
48 | PWM_ASSERT(rndObj); | 48 | PWM_ASSERT(rndObj); |
49 | return rndObj; | 49 | return rndObj; |
50 | } | 50 | } |
51 | static void init() | 51 | static void init() |
52 | { | 52 | { |
53 | PWM_ASSERT(!rndObj); | 53 | PWM_ASSERT(!rndObj); |
54 | rndObj = new Randomizer; | 54 | rndObj = new Randomizer; |
55 | } | 55 | } |
56 | static void cleanup() | 56 | static void cleanup() |
57 | { | 57 | { |
58 | delete_ifnot_null(rndObj); | 58 | delete_ifnot_null(rndObj); |
59 | } | 59 | } |
60 | 60 | ||
61 | /** generate random char */ | 61 | /** generate random char */ |
62 | char genRndChar(); | 62 | char genRndChar(); |
diff --git a/pwmanager/pwmanager/serializer.cpp b/pwmanager/pwmanager/serializer.cpp index 5c6568f..2d6498e 100644 --- a/pwmanager/pwmanager/serializer.cpp +++ b/pwmanager/pwmanager/serializer.cpp | |||
@@ -1,78 +1,78 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | 12 | ||
13 | /*************************************************************************** | 13 | /*************************************************************************** |
14 | * copyright (C) 2004 by Ulf Schenk | 14 | * copyright (C) 2004 by Ulf Schenk |
15 | * This file is originaly based on version 2.0 of pwmanager | 15 | * This file is originaly based on version 1.1 of pwmanager |
16 | * and was modified to run on embedded devices that run microkde | 16 | * and was modified to run on embedded devices that run microkde |
17 | * | 17 | * |
18 | * $Id$ | 18 | * $Id$ |
19 | **************************************************************************/ | 19 | **************************************************************************/ |
20 | 20 | ||
21 | #include "serializer.h" | 21 | #include "serializer.h" |
22 | #include "pwmexception.h" | 22 | #include "pwmexception.h" |
23 | 23 | ||
24 | #ifdef PWM_EMBEDDED | 24 | #ifdef PWM_EMBEDDED |
25 | #include <kglobal.h> | 25 | #include <kglobal.h> |
26 | #include <klocale.h> | 26 | #include <klocale.h> |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | /* enable/disable serializer debugging (0/1) */ | 29 | /* enable/disable serializer debugging (0/1) */ |
30 | #define SERIALIZER_DEBUG1 | 30 | #define SERIALIZER_DEBUG0 |
31 | /* use the old xml tags for writing (0/1) */ | 31 | /* use the old xml tags for writing (0/1) */ |
32 | #define USE_OLD_TAGS 0 | 32 | #define USE_OLD_TAGS 0 |
33 | /* write a CDATA section (0/1) */ | 33 | /* write a CDATA section (0/1) */ |
34 | #define WRITE_CDATA_SEC 0 | 34 | #define WRITE_CDATA_SEC 0 |
35 | 35 | ||
36 | 36 | ||
37 | #define META_CREATE_DATE"c" | 37 | #define META_CREATE_DATE"c" |
38 | #define META_VALID_DATE "v" | 38 | #define META_VALID_DATE "v" |
39 | #define META_EXPIRE_DATE"e" | 39 | #define META_EXPIRE_DATE"e" |
40 | #define META_UPDATE_DATE"u" | 40 | #define META_UPDATE_DATE"u" |
41 | #define META_UPDATE_INT "i" | 41 | #define META_UPDATE_INT "i" |
42 | //US ENH : uniqueid | 42 | //US ENH : uniqueid |
43 | #define META_UNIQUEID "n" | 43 | #define META_UNIQUEID "n" |
44 | #define SYNC_ROOT "s" | 44 | #define SYNC_ROOT "s" |
45 | #define SYNC_TARGET_PREFIX "t" | 45 | #define SYNC_TARGET_PREFIX "t" |
46 | #define SYNC_TARGET_NAME "n" | 46 | #define SYNC_TARGET_NAME "n" |
47 | 47 | ||
48 | 48 | ||
49 | /* This is compatibility stuff. | 49 | /* This is compatibility stuff. |
50 | * The names of the entries have changed and here are the | 50 | * The names of the entries have changed and here are the |
51 | * new and old ones | 51 | * new and old ones |
52 | */ | 52 | */ |
53 | #define ROOT_MAGIC_OLD "PwM-xml-dat" | 53 | #define ROOT_MAGIC_OLD "PwM-xml-dat" |
54 | #define VER_STR_OLD "ver" | 54 | #define VER_STR_OLD "ver" |
55 | #define COMPAT_VER_OLD "0x02" | 55 | #define COMPAT_VER_OLD "0x02" |
56 | #define CAT_ROOT_OLD "categories" | 56 | #define CAT_ROOT_OLD "categories" |
57 | #define CAT_PREFIX_OLD "cat_" | 57 | #define CAT_PREFIX_OLD "cat_" |
58 | #define CAT_NAME_OLD "name" | 58 | #define CAT_NAME_OLD "name" |
59 | #define ENTRY_PREFIX_OLD"entry_" | 59 | #define ENTRY_PREFIX_OLD"entry_" |
60 | #define ENTRY_DESC_OLD "desc" | 60 | #define ENTRY_DESC_OLD "desc" |
61 | #define ENTRY_NAME_OLD "name" | 61 | #define ENTRY_NAME_OLD "name" |
62 | #define ENTRY_PW_OLD "pw" | 62 | #define ENTRY_PW_OLD "pw" |
63 | #define ENTRY_COMMENT_OLD"comment" | 63 | #define ENTRY_COMMENT_OLD"comment" |
64 | #define ENTRY_URL_OLD "url" | 64 | #define ENTRY_URL_OLD "url" |
65 | #define ENTRY_LAUNCHER_OLD"launcher" | 65 | #define ENTRY_LAUNCHER_OLD"launcher" |
66 | #define ENTRY_LVP_OLD "listViewPos" | 66 | #define ENTRY_LVP_OLD "listViewPos" |
67 | #define ENTRY_BIN_OLD "b" | 67 | #define ENTRY_BIN_OLD "b" |
68 | #define ENTRY_META_OLD "m" | 68 | #define ENTRY_META_OLD "m" |
69 | 69 | ||
70 | #define ROOT_MAGIC_NEW "P" | 70 | #define ROOT_MAGIC_NEW "P" |
71 | #define VER_STR_NEW "v" | 71 | #define VER_STR_NEW "v" |
72 | #define COMPAT_VER_NEW "2" | 72 | #define COMPAT_VER_NEW "2" |
73 | #define CAT_ROOT_NEW "c" | 73 | #define CAT_ROOT_NEW "c" |
74 | #define CAT_PREFIX_NEW "c" | 74 | #define CAT_PREFIX_NEW "c" |
75 | #define CAT_NAME_NEW "n" | 75 | #define CAT_NAME_NEW "n" |
76 | #define ENTRY_PREFIX_NEW"e" | 76 | #define ENTRY_PREFIX_NEW"e" |
77 | #define ENTRY_DESC_NEW "d" | 77 | #define ENTRY_DESC_NEW "d" |
78 | #define ENTRY_NAME_NEW "n" | 78 | #define ENTRY_NAME_NEW "n" |
diff --git a/pwmanager/pwmanager/serializer.h b/pwmanager/pwmanager/serializer.h index ee61b94..df50e42 100644 --- a/pwmanager/pwmanager/serializer.h +++ b/pwmanager/pwmanager/serializer.h | |||
@@ -1,63 +1,63 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | 12 | ||
13 | /*************************************************************************** | 13 | /*************************************************************************** |
14 | * copyright (C) 2004 by Ulf Schenk | 14 | * copyright (C) 2004 by Ulf Schenk |
15 | * This file is originaly based on version 2.0 of pwmanager | 15 | * This file is originaly based on version 1.1 of pwmanager |
16 | * and was modified to run on embedded devices that run microkde | 16 | * and was modified to run on embedded devices that run microkde |
17 | * | 17 | * |
18 | * $Id$ | 18 | * $Id$ |
19 | **************************************************************************/ | 19 | **************************************************************************/ |
20 | 20 | ||
21 | #ifndef __SERIALIZER_H | 21 | #ifndef __SERIALIZER_H |
22 | #define __SERIALIZER_H | 22 | #define __SERIALIZER_H |
23 | 23 | ||
24 | #include "pwmdoc.h" | 24 | #include "pwmdoc.h" |
25 | 25 | ||
26 | #include <qcstring.h> | 26 | #include <qcstring.h> |
27 | #include <qdom.h> | 27 | #include <qdom.h> |
28 | 28 | ||
29 | #include <vector> | 29 | #include <vector> |
30 | 30 | ||
31 | using std::vector; | 31 | using std::vector; |
32 | 32 | ||
33 | /** This serializes its input data into | 33 | /** This serializes its input data into |
34 | * the PwManager-XML-datastream, that becomes | 34 | * the PwManager-XML-datastream, that becomes |
35 | * encrypted and maybe compressed | 35 | * encrypted and maybe compressed |
36 | */ | 36 | */ |
37 | class Serializer | 37 | class Serializer |
38 | { | 38 | { |
39 | public: | 39 | public: |
40 | /** construct an empty serializer document */ | 40 | /** construct an empty serializer document */ |
41 | Serializer(); | 41 | Serializer(); |
42 | /** construct a serializer document and parse "buffer" */ | 42 | /** construct a serializer document and parse "buffer" */ |
43 | Serializer(const QCString &buffer); | 43 | Serializer(const QCString &buffer); |
44 | /** destructor */ | 44 | /** destructor */ |
45 | virtual ~Serializer(); | 45 | virtual ~Serializer(); |
46 | 46 | ||
47 | /** clears all data */ | 47 | /** clears all data */ |
48 | void clear(); | 48 | void clear(); |
49 | /** parse the given data buffer */ | 49 | /** parse the given data buffer */ |
50 | bool parseXml(const QCString &buffer); | 50 | bool parseXml(const QCString &buffer); |
51 | /** returns the current XML data */ | 51 | /** returns the current XML data */ |
52 | QCString getXml(); | 52 | QCString getXml(); |
53 | /** serialize "dta" and store it as XML data */ | 53 | /** serialize "dta" and store it as XML data */ |
54 | //US ENH: we need to serialize and deserialize not only categories, but also synctargets | 54 | //US ENH: we need to serialize and deserialize not only categories, but also synctargets |
55 | bool serialize(PwMItem &dta); | 55 | bool serialize(PwMItem &dta); |
56 | /** deserialize the (parsed) XML data and store it in "dta" */ | 56 | /** deserialize the (parsed) XML data and store it in "dta" */ |
57 | bool deSerialize(PwMItem *dta); | 57 | bool deSerialize(PwMItem *dta); |
58 | /** sets the initial default lockStat we should assign */ | 58 | /** sets the initial default lockStat we should assign */ |
59 | void setDefaultLockStat(bool stat) | 59 | void setDefaultLockStat(bool stat) |
60 | { defaultLockStat = stat; } | 60 | { defaultLockStat = stat; } |
61 | 61 | ||
62 | protected: | 62 | protected: |
63 | /** main data holder */ | 63 | /** main data holder */ |