summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-05-10 09:27:32 (UTC)
committer mickeyl <mickeyl>2005-05-10 09:27:32 (UTC)
commitce515e60ba66d4b1540879b17b2b31b5fac627d3 (patch) (unidiff)
tree6fce8900e1164d148a792fb49558c90c09dfc178
parent2ac78fd7a789959e8f40e6082f4f86818f499278 (diff)
downloadopie-ce515e60ba66d4b1540879b17b2b31b5fac627d3.zip
opie-ce515e60ba66d4b1540879b17b2b31b5fac627d3.tar.gz
opie-ce515e60ba66d4b1540879b17b2b31b5fac627d3.tar.bz2
s/qWarning/qDebug/
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/oglobal.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp
index 2968a7d..706ac6c 100644
--- a/libopie2/opiecore/oglobal.cpp
+++ b/libopie2/opiecore/oglobal.cpp
@@ -15,130 +15,131 @@
15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 15 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
16 : .. .:, . . . without even the implied warranty of 16 : .. .:, . . . without even the implied warranty of
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more 19..}^=.= = ; Library General Public License for more
20++= -. .` .: details. 20++= -. .` .: details.
21 : = ...= . :.=- 21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU 22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include <opie2/oglobal.h> 30#include <opie2/oglobal.h>
31 31
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qdir.h> 33#include <qdir.h>
34#include <qpe/mimetype.h> 34#include <qpe/mimetype.h>
35#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
36#include <qpe/storage.h> 36#include <qpe/storage.h>
37 37
38#include <unistd.h> 38#include <unistd.h>
39#include <sys/types.h> 39#include <sys/types.h>
40 40
41using namespace Opie::Core; 41using namespace Opie::Core;
42 42
43static const char Base64EncMap[64] = 43static const char Base64EncMap[64] =
44{ 44{
45 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 45 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
46 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 46 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
47 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 47 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
48 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 48 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
49 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 49 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
50 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 50 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
51 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33, 51 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33,
52 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F 52 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F
53}; 53};
54 54
55static char Base64DecMap[128] = 55static char Base64DecMap[128] =
56{ 56{
57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 62 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F,
63 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 63 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
64 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 65 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
66 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 66 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
67 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 67 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
68 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 68 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
69 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 69 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
70 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 70 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
71 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 71 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
72 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 72 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00
73}; 73};
74 74
75 75
76OConfig* OGlobal::_config = 0; 76OConfig* OGlobal::_config = 0;
77OConfig* OGlobal::_qpe_config = 0; 77OConfig* OGlobal::_qpe_config = 0;
78 78
79void OGlobal::clean_up() { 79void OGlobal::clean_up()
80 qWarning( "Oglobal clean up" ); 80{
81 qDebug( "Oglobal clean up" );
81 delete OGlobal::_config; 82 delete OGlobal::_config;
82 delete OGlobal::_qpe_config; 83 delete OGlobal::_qpe_config;
83 OGlobal::_config = 0; 84 OGlobal::_config = 0;
84 OGlobal::_qpe_config = 0; 85 OGlobal::_qpe_config = 0;
85} 86}
86 87
87OConfig* OGlobal::config() 88OConfig* OGlobal::config()
88{ 89{
89 if ( !OGlobal::_config ) 90 if ( !OGlobal::_config )
90 { 91 {
91 // odebug classes are reading config, so can't use them here! 92 // odebug classes are reading config, so can't use them here!
92 qAddPostRoutine( OGlobal::clean_up ); 93 qAddPostRoutine( OGlobal::clean_up );
93 qDebug( "OGlobal::creating global configuration instance." ); 94 qDebug( "OGlobal::creating global configuration instance." );
94 OGlobal::_config = new OConfig( "global" ); 95 OGlobal::_config = new OConfig( "global" );
95 } 96 }
96 return OGlobal::_config; 97 return OGlobal::_config;
97} 98}
98 99
99 100
100/** 101/**
101 * Return the internal builtin Global::Command object 102 * Return the internal builtin Global::Command object
102 * 103 *
103 */ 104 */
104Global::Command* OGlobal::builtinCommands() { 105Global::Command* OGlobal::builtinCommands() {
105 return builtin; 106 return builtin;
106} 107}
107 108
108 109
109/** 110/**
110 * Return the internal builtin QGuardedPtr<QWidget> object 111 * Return the internal builtin QGuardedPtr<QWidget> object
111 */ 112 */
112QGuardedPtr<QWidget>* OGlobal::builtinRunning() { 113QGuardedPtr<QWidget>* OGlobal::builtinRunning() {
113 return running; 114 return running;
114} 115}
115 116
116 117
117/** 118/**
118 * \brief generate a new UUID as QString 119 * \brief generate a new UUID as QString
119 * Return a new UUID as QString. UUID are global unique 120 * Return a new UUID as QString. UUID are global unique
120 * 121 *
121 * 122 *
122 * @return the UUID or QString::null 123 * @return the UUID or QString::null
123 */ 124 */
124QString OGlobal::generateUuid() { 125QString OGlobal::generateUuid() {
125 QFile file( "/proc/sys/kernel/random/uuid" ); 126 QFile file( "/proc/sys/kernel/random/uuid" );
126 if (!file.open(IO_ReadOnly ) ) 127 if (!file.open(IO_ReadOnly ) )
127 return QString::null; 128 return QString::null;
128 129
129 QTextStream stream(&file); 130 QTextStream stream(&file);
130 131
131 return "{" + stream.read().stripWhiteSpace() + "}"; 132 return "{" + stream.read().stripWhiteSpace() + "}";
132} 133}
133 134
134 135
135/** 136/**
136 * \brief Encode a QByteArray in base64 137 * \brief Encode a QByteArray in base64
137 * 138 *
138 * An Implementation of the RF1521 base64 encoding. 139 * An Implementation of the RF1521 base64 encoding.
139 * 140 *
140 * The boolean argument determines if the encoded data is 141 * The boolean argument determines if the encoded data is
141 * going to be restricted to 76 characters or less per line 142 * going to be restricted to 76 characters or less per line
142 * as specified by RFC 2045. If @p insertLFs is true, then 143 * as specified by RFC 2045. If @p insertLFs is true, then
143 * there will be 76 characters or less per line. 144 * there will be 76 characters or less per line.
144 * 145 *