summaryrefslogtreecommitdiff
authorchicken <chicken>2004-03-01 15:58:07 (UTC)
committer chicken <chicken>2004-03-01 15:58:07 (UTC)
commit931c55406a043195712955c732a875e17899df90 (patch) (unidiff)
tree8097c88ee3e96f8fb613ccca1ebf36bf73070dcc
parent87676b131aad1bfe979570a48107527db4040020 (diff)
downloadopie-931c55406a043195712955c732a875e17899df90.zip
opie-931c55406a043195712955c732a875e17899df90.tar.gz
opie-931c55406a043195712955c732a875e17899df90.tar.bz2
fix includes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/odebug.cpp11
-rw-r--r--libopie2/opiecore/oglobal.cpp1
-rw-r--r--libopie2/opiecore/oglobalsettings.cpp3
-rw-r--r--libopie2/opiecore/oprocctrl.cpp1
-rw-r--r--libopie2/opiecore/oprocess.cpp2
-rw-r--r--libopie2/opiedb/osqlbackendmanager.cpp1
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp1
-rw-r--r--libopie2/opiedb/osqlmanager.cpp2
-rw-r--r--libopie2/opiedb/osqlresult.cpp1
-rw-r--r--libopie2/opiemm/osoundsystem.cpp1
-rw-r--r--libopie2/opienet/omanufacturerdb.cpp1
-rw-r--r--libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp2
-rw-r--r--libopie2/opiepim/core/opimcontact.cpp4
-rw-r--r--libopie2/opiepim/core/opimcontactfields.cpp2
-rw-r--r--libopie2/opiepim/core/opimevent.cpp3
-rw-r--r--libopie2/opiepim/core/opimnotify.cpp1
-rw-r--r--libopie2/opiepim/core/opimrecord.cpp1
-rw-r--r--libopie2/opiepim/core/opimtodo.cpp3
-rw-r--r--libopie2/opieui/ofontselector.cpp1
-rw-r--r--libopie2/opieui/olistview.cpp3
-rw-r--r--libopie2/opieui/opopupmenu.cpp7
-rw-r--r--libopie2/opieui/oselector.cpp1
-rw-r--r--libopie2/opieui/oseparator.cpp1
-rw-r--r--libopie2/opieui/otimepicker.cpp3
-rw-r--r--libopie2/opieui/oversatileview.cpp11
25 files changed, 1 insertions, 67 deletions
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp
index 4505ce7..a40ef53 100644
--- a/libopie2/opiecore/odebug.cpp
+++ b/libopie2/opiecore/odebug.cpp
@@ -1,159 +1,148 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de) 3 (C) 2003 Michael 'Mickey' Lauer (mickey@tm.informatik.uni-frankfurt.de)
4 (C) 2002 Holger Freyther (freyther@kde.org) 4 (C) 2002 Holger Freyther (freyther@kde.org)
5 (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) 5 (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org)
6 =. 6 =.
7 .=l. 7 .=l.
8           .>+-= 8           .>+-=
9 _;:,     .>    :=|. This program is free software; you can 9 _;:,     .>    :=|. This program is free software; you can
10.> <`_,   >  .   <= redistribute it and/or modify it under 10.> <`_,   >  .   <= redistribute it and/or modify it under
11:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 11:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
12.="- .-=="i,     .._ License as published by the Free Software 12.="- .-=="i,     .._ License as published by the Free Software
13 - .   .-<_>     .<> Foundation; either version 2 of the License, 13 - .   .-<_>     .<> Foundation; either version 2 of the License,
14     ._= =}       : or (at your option) any later version. 14     ._= =}       : or (at your option) any later version.
15    .%`+i>       _;_. 15    .%`+i>       _;_.
16    .i_,=:_.      -<s. This program is distributed in the hope that 16    .i_,=:_.      -<s. This program is distributed in the hope that
17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18    : ..    .:,     . . . without even the implied warranty of 18    : ..    .:,     . . . without even the implied warranty of
19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21..}^=.=       =       ; Library General Public License for more 21..}^=.=       =       ; Library General Public License for more
22++=   -.     .`     .: details. 22++=   -.     .`     .: details.
23 :     =  ...= . :.=- 23 :     =  ...= . :.=-
24 -.   .:....=;==+<; You should have received a copy of the GNU 24 -.   .:....=;==+<; You should have received a copy of the GNU
25  -_. . .   )=.  = Library General Public License along with 25  -_. . .   )=.  = Library General Public License along with
26    --        :-=` this library; see the file COPYING.LIB. 26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation, 27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, 28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA. 29 Boston, MA 02111-1307, USA.
30*/ 30*/
31 31
32// Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo 32// Include this header without OPIE_NO_DEBUG defined to avoid having the oDebugInfo
33// functions inlined to noops (which would then conflict with their definition here). 33// functions inlined to noops (which would then conflict with their definition here).
34 34
35#include <opie2/odebug.h> 35#include <opie2/odebug.h>
36 36
37#ifdef OPIE_NO_DEBUG 37#ifdef OPIE_NO_DEBUG
38#undef odDebug 38#undef odDebug
39#undef odBacktrace 39#undef odBacktrace
40#endif 40#endif
41 41
42/* OPIE */ 42/* OPIE */
43 43
44#include <opie2/oapplication.h> 44#include <opie2/oapplication.h>
45#include <opie2/oglobalsettings.h> 45#include <opie2/oglobalsettings.h>
46#include <opie2/oconfig.h> 46#include <opie2/oconfig.h>
47 47
48/* QT */ 48/* QT */
49 49
50#include <qbrush.h>
51#include <qdatetime.h>
52#include <qfile.h> 50#include <qfile.h>
53#include <qhostaddress.h>
54#include <qmessagebox.h> 51#include <qmessagebox.h>
55#include <qintdict.h>
56#include <qpoint.h>
57#include <qrect.h>
58#include <qregion.h>
59#include <qsize.h>
60#include <qsocketdevice.h> 52#include <qsocketdevice.h>
61#include <qstring.h>
62#include <qstringlist.h>
63#include <qtextstream.h>
64 53
65/* UNIX */ 54/* UNIX */
66 55
67#include <stdlib.h> // abort 56#include <stdlib.h> // abort
68#include <unistd.h> // getpid 57#include <unistd.h> // getpid
69#include <stdarg.h> // vararg stuff 58#include <stdarg.h> // vararg stuff
70#include <ctype.h> // isprint 59#include <ctype.h> // isprint
71#include <syslog.h> 60#include <syslog.h>
72#include <errno.h> 61#include <errno.h>
73#include <string.h> 62#include <string.h>
74 63
75#ifndef OPIE_NO_BACKTRACE 64#ifndef OPIE_NO_BACKTRACE
76#include <execinfo.h> 65#include <execinfo.h>
77#endif 66#endif
78 67
79 68
80/*====================================================================================== 69/*======================================================================================
81 * debug levels 70 * debug levels
82 *======================================================================================*/ 71 *======================================================================================*/
83 72
84enum DebugLevels { 73enum DebugLevels {
85 ODEBUG_INFO = 0, 74 ODEBUG_INFO = 0,
86 ODEBUG_WARN = 1, 75 ODEBUG_WARN = 1,
87 ODEBUG_ERROR = 2, 76 ODEBUG_ERROR = 2,
88 ODEBUG_FATAL = 3 77 ODEBUG_FATAL = 3
89}; 78};
90 79
91/*====================================================================================== 80/*======================================================================================
92 * oDebug private data 81 * oDebug private data
93 *======================================================================================*/ 82 *======================================================================================*/
94 83
95/*====================================================================================== 84/*======================================================================================
96 * the main debug function 85 * the main debug function
97 *======================================================================================*/ 86 *======================================================================================*/
98 87
99static void oDebugBackend( unsigned short level, unsigned int area, const char *data) 88static void oDebugBackend( unsigned short level, unsigned int area, const char *data)
100{ 89{
101 //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); 90 //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data );
102 91
103 // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an 92 // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an
104 // ML: example use. I think it's not necessary to implement such a strategy here. 93 // ML: example use. I think it's not necessary to implement such a strategy here.
105 // ML: Comments? 94 // ML: Comments?
106 95
107 int priority = 0; 96 int priority = 0;
108 QString caption; 97 QString caption;
109 QString lev; 98 QString lev;
110 switch( level ) 99 switch( level )
111 { 100 {
112 case ODEBUG_INFO: lev = "(Info)"; caption = "Info"; priority = LOG_INFO; break; 101 case ODEBUG_INFO: lev = "(Info)"; caption = "Info"; priority = LOG_INFO; break;
113 case ODEBUG_WARN: lev = "(Warn)"; caption = "Warning"; priority = LOG_WARNING; break; 102 case ODEBUG_WARN: lev = "(Warn)"; caption = "Warning"; priority = LOG_WARNING; break;
114 case ODEBUG_FATAL: lev = "(Fatal)"; caption = "Fatal Error"; priority = LOG_CRIT; break; 103 case ODEBUG_FATAL: lev = "(Fatal)"; caption = "Fatal Error"; priority = LOG_CRIT; break;
115 default: qDebug( "oDebugBackend: Warning: Unknown debug level! - defaulting to ODEBUG_ERROR." ); 104 default: qDebug( "oDebugBackend: Warning: Unknown debug level! - defaulting to ODEBUG_ERROR." );
116 case ODEBUG_ERROR: lev = "(Error)"; caption = "Error"; priority = LOG_ERR; break; 105 case ODEBUG_ERROR: lev = "(Error)"; caption = "Error"; priority = LOG_ERR; break;
117 } 106 }
118 107
119 short output = OGlobalSettings::debugMode(); 108 short output = OGlobalSettings::debugMode();
120 if (!oApp && (output == 1)) 109 if (!oApp && (output == 1))
121 { 110 {
122 qDebug( "oDebugBackend: Warning: no oapplication object - can't use MsgBox" ); 111 qDebug( "oDebugBackend: Warning: no oapplication object - can't use MsgBox" );
123 output = 2; // need an application object to use MsgBox 112 output = 2; // need an application object to use MsgBox
124 } 113 }
125 114
126 // gcc 2.9x is dumb and sucks... can you hear it? 115 // gcc 2.9x is dumb and sucks... can you hear it?
127 //QString areaName = (oApp) ? oApp->appName() : "<unknown>"; 116 //QString areaName = (oApp) ? oApp->appName() : "<unknown>";
128 QString areaName; 117 QString areaName;
129 if ( oApp ) areaName = oApp->appName(); 118 if ( oApp ) areaName = oApp->appName();
130 else areaName = "<unknown>"; 119 else areaName = "<unknown>";
131 120
132 // Output 121 // Output
133 switch( output ) 122 switch( output )
134 { 123 {
135 case -1: // ignore 124 case -1: // ignore
136 { 125 {
137 return; 126 return;
138 } 127 }
139 case 0: // File 128 case 0: // File
140 { 129 {
141 QString outputFilename = OGlobalSettings::debugOutput(); 130 QString outputFilename = OGlobalSettings::debugOutput();
142 131
143 const int BUFSIZE = 4096; 132 const int BUFSIZE = 4096;
144 char buf[BUFSIZE] = ""; 133 char buf[BUFSIZE] = "";
145 buf[BUFSIZE-1] = '\0'; 134 buf[BUFSIZE-1] = '\0';
146 int nSize; 135 int nSize;
147 136
148 nSize = snprintf( buf, BUFSIZE-1, "%s: %s", (const char*) areaName, data); 137 nSize = snprintf( buf, BUFSIZE-1, "%s: %s", (const char*) areaName, data);
149 138
150 QFile outputFile( outputFilename ); 139 QFile outputFile( outputFilename );
151 if ( outputFile.open( IO_WriteOnly | IO_Append ) ) 140 if ( outputFile.open( IO_WriteOnly | IO_Append ) )
152 { 141 {
153 if ( ( nSize == -1 ) || ( nSize >= BUFSIZE ) ) 142 if ( ( nSize == -1 ) || ( nSize >= BUFSIZE ) )
154 { 143 {
155 outputFile.writeBlock( buf, BUFSIZE-1 ); 144 outputFile.writeBlock( buf, BUFSIZE-1 );
156 } 145 }
157 else 146 else
158 { 147 {
159 outputFile.writeBlock( buf, nSize ); 148 outputFile.writeBlock( buf, nSize );
diff --git a/libopie2/opiecore/oglobal.cpp b/libopie2/opiecore/oglobal.cpp
index 879e80f..1aa206e 100644
--- a/libopie2/opiecore/oglobal.cpp
+++ b/libopie2/opiecore/oglobal.cpp
@@ -1,128 +1,127 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> 3 Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 =. Copyright (C) 2004 Holger 'zecke' Freyther <zecke@handhelds.org> 4 =. Copyright (C) 2004 Holger 'zecke' Freyther <zecke@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 <qfile.h>
33#include <qtextstream.h> 32#include <qtextstream.h>
34#include <qdir.h> 33#include <qdir.h>
35#include <qpe/mimetype.h> 34#include <qpe/mimetype.h>
36#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
37#include <qpe/storage.h> 36#include <qpe/storage.h>
38 37
39#include <unistd.h> 38#include <unistd.h>
40#include <sys/types.h> 39#include <sys/types.h>
41 40
42static const char Base64EncMap[64] = 41static const char Base64EncMap[64] =
43{ 42{
44 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 43 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
45 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 44 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
46 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 45 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
47 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 46 0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
48 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 47 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
49 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 48 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
50 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33, 49 0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33,
51 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F 50 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F
52}; 51};
53 52
54static char Base64DecMap[128] = 53static char Base64DecMap[128] =
55{ 54{
56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
60 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F, 60 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F,
62 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 61 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
63 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
64 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 63 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
65 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 64 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
66 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 65 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
67 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 66 0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
68 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 67 0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
69 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 68 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
70 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 69 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
71 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00 70 0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00
72}; 71};
73 72
74 73
75OConfig* OGlobal::_config = 0; 74OConfig* OGlobal::_config = 0;
76OConfig* OGlobal::_qpe_config = 0; 75OConfig* OGlobal::_qpe_config = 0;
77 76
78OConfig* OGlobal::config() 77OConfig* OGlobal::config()
79{ 78{
80 if ( !OGlobal::_config ) 79 if ( !OGlobal::_config )
81 { 80 {
82 // odebug classes are reading config, so can't use them here! 81 // odebug classes are reading config, so can't use them here!
83 qDebug( "OGlobal::creating global configuration instance." ); 82 qDebug( "OGlobal::creating global configuration instance." );
84 OGlobal::_config = new OConfig( "global" ); 83 OGlobal::_config = new OConfig( "global" );
85 } 84 }
86 return OGlobal::_config; 85 return OGlobal::_config;
87} 86}
88 87
89 88
90/** 89/**
91 * Return the internal builtin Global::Command object 90 * Return the internal builtin Global::Command object
92 * 91 *
93 */ 92 */
94Global::Command* OGlobal::builtinCommands() { 93Global::Command* OGlobal::builtinCommands() {
95 return builtin; 94 return builtin;
96} 95}
97 96
98 97
99/** 98/**
100 * Return the internal builtin QGuardedPtr<QWidget> object 99 * Return the internal builtin QGuardedPtr<QWidget> object
101 */ 100 */
102QGuardedPtr<QWidget>* OGlobal::builtinRunning() { 101QGuardedPtr<QWidget>* OGlobal::builtinRunning() {
103 return running; 102 return running;
104} 103}
105 104
106 105
107/** 106/**
108 * \brief generate a new UUID as QString 107 * \brief generate a new UUID as QString
109 * Return a new UUID as QString. UUID are global unique 108 * Return a new UUID as QString. UUID are global unique
110 * 109 *
111 * 110 *
112 * @return the UUID or QString::null 111 * @return the UUID or QString::null
113 */ 112 */
114QString OGlobal::generateUuid() { 113QString OGlobal::generateUuid() {
115 QFile file( "/proc/sys/kernel/random/uuid" ); 114 QFile file( "/proc/sys/kernel/random/uuid" );
116 if (!file.open(IO_ReadOnly ) ) 115 if (!file.open(IO_ReadOnly ) )
117 return QString::null; 116 return QString::null;
118 117
119 QTextStream stream(&file); 118 QTextStream stream(&file);
120 119
121 return "{" + stream.read().stripWhiteSpace() + "}"; 120 return "{" + stream.read().stripWhiteSpace() + "}";
122} 121}
123 122
124 123
125/** 124/**
126 * \brief Encode a QByteArray in base64 125 * \brief Encode a QByteArray in base64
127 * 126 *
128 * An Implementation of the RF1521 base64 encoding. 127 * An Implementation of the RF1521 base64 encoding.
diff --git a/libopie2/opiecore/oglobalsettings.cpp b/libopie2/opiecore/oglobalsettings.cpp
index 66adbd0..192e55b 100644
--- a/libopie2/opiecore/oglobalsettings.cpp
+++ b/libopie2/opiecore/oglobalsettings.cpp
@@ -1,140 +1,137 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de> 4              Copyright (C) 2003 Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 Inspired by the KDE globalsettings which are 5 Inspired by the KDE globalsettings which are
6 Copyright (C) 2000 David Faure <faure@kde.org> 6 Copyright (C) 2000 David Faure <faure@kde.org>
7 =. 7 =.
8 .=l. 8 .=l.
9           .>+-= 9           .>+-=
10 _;:,     .>    :=|. This program is free software; you can 10 _;:,     .>    :=|. This program is free software; you can
11.> <`_,   >  .   <= redistribute it and/or modify it under 11.> <`_,   >  .   <= redistribute it and/or modify it under
12:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 12:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
13.="- .-=="i,     .._ License as published by the Free Software 13.="- .-=="i,     .._ License as published by the Free Software
14 - .   .-<_>     .<> Foundation; either version 2 of the License, 14 - .   .-<_>     .<> Foundation; either version 2 of the License,
15     ._= =}       : or (at your option) any later version. 15     ._= =}       : or (at your option) any later version.
16    .%`+i>       _;_. 16    .%`+i>       _;_.
17    .i_,=:_.      -<s. This program is distributed in the hope that 17    .i_,=:_.      -<s. This program is distributed in the hope that
18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 18     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
19    : ..    .:,     . . . without even the implied warranty of 19    : ..    .:,     . . . without even the implied warranty of
20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 20    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 21  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.=       =       ; Library General Public License for more 22..}^=.=       =       ; Library General Public License for more
23++=   -.     .`     .: details. 23++=   -.     .`     .: details.
24 :     =  ...= . :.=- 24 :     =  ...= . :.=-
25 -.   .:....=;==+<; You should have received a copy of the GNU 25 -.   .:....=;==+<; You should have received a copy of the GNU
26  -_. . .   )=.  = Library General Public License along with 26  -_. . .   )=.  = Library General Public License along with
27    --        :-=` this library; see the file COPYING.LIB. 27    --        :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
31*/ 31*/
32 32
33/* OPIE */ 33/* OPIE */
34 34
35#include <opie2/oglobalsettings.h> 35#include <opie2/oglobalsettings.h>
36#include <opie2/oconfig.h> 36#include <opie2/oconfig.h>
37#include <opie2/oglobal.h> 37#include <opie2/oglobal.h>
38 38
39/* QT */ 39/* QT */
40 40
41#include <qobject.h>
42#include <qdir.h> 41#include <qdir.h>
43#include <qpixmap.h>
44#include <qfontinfo.h>
45 42
46/* UNIX */ 43/* UNIX */
47 44
48#include <stdlib.h> 45#include <stdlib.h>
49 46
50QString* OGlobalSettings::s_desktopPath = 0; 47QString* OGlobalSettings::s_desktopPath = 0;
51QString* OGlobalSettings::s_autostartPath = 0; 48QString* OGlobalSettings::s_autostartPath = 0;
52QString* OGlobalSettings::s_trashPath = 0; 49QString* OGlobalSettings::s_trashPath = 0;
53QString* OGlobalSettings::s_documentPath = 0; 50QString* OGlobalSettings::s_documentPath = 0;
54QFont *OGlobalSettings::_generalFont = 0; 51QFont *OGlobalSettings::_generalFont = 0;
55QFont *OGlobalSettings::_fixedFont = 0; 52QFont *OGlobalSettings::_fixedFont = 0;
56QFont *OGlobalSettings::_toolBarFont = 0; 53QFont *OGlobalSettings::_toolBarFont = 0;
57QFont *OGlobalSettings::_menuFont = 0; 54QFont *OGlobalSettings::_menuFont = 0;
58QFont *OGlobalSettings::_windowTitleFont = 0; 55QFont *OGlobalSettings::_windowTitleFont = 0;
59QFont *OGlobalSettings::_taskbarFont = 0; 56QFont *OGlobalSettings::_taskbarFont = 0;
60 57
61QColor *OGlobalSettings::OpieGray = 0; 58QColor *OGlobalSettings::OpieGray = 0;
62QColor *OGlobalSettings::OpieHighlight = 0; 59QColor *OGlobalSettings::OpieHighlight = 0;
63QColor *OGlobalSettings::OpieAlternate = 0; 60QColor *OGlobalSettings::OpieAlternate = 0;
64 61
65OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0; 62OGlobalSettings::OMouseSettings *OGlobalSettings::s_mouseSettings = 0;
66 63
67//FIXME: Add manipulators to the accessors 64//FIXME: Add manipulators to the accessors
68 65
69int OGlobalSettings::dndEventDelay() 66int OGlobalSettings::dndEventDelay()
70{ 67{
71 OConfig *c = OGlobal::config(); 68 OConfig *c = OGlobal::config();
72 OConfigGroupSaver cgs( c, "General" ); 69 OConfigGroupSaver cgs( c, "General" );
73 return c->readNumEntry("DndDelay", 2); 70 return c->readNumEntry("DndDelay", 2);
74} 71}
75 72
76bool OGlobalSettings::singleClick() 73bool OGlobalSettings::singleClick()
77{ 74{
78 OConfig *c = OGlobal::config(); 75 OConfig *c = OGlobal::config();
79 OConfigGroupSaver cgs( c, "OPIE" ); 76 OConfigGroupSaver cgs( c, "OPIE" );
80 return c->readBoolEntry("SingleClick", OPIE_DEFAULT_SINGLECLICK); 77 return c->readBoolEntry("SingleClick", OPIE_DEFAULT_SINGLECLICK);
81} 78}
82 79
83bool OGlobalSettings::insertTearOffHandle() 80bool OGlobalSettings::insertTearOffHandle()
84{ 81{
85 OConfig *c = OGlobal::config(); 82 OConfig *c = OGlobal::config();
86 OConfigGroupSaver cgs( c, "OPIE" ); 83 OConfigGroupSaver cgs( c, "OPIE" );
87 return c->readBoolEntry("InsertTearOffHandle", OPIE_DEFAULT_INSERTTEAROFFHANDLES); 84 return c->readBoolEntry("InsertTearOffHandle", OPIE_DEFAULT_INSERTTEAROFFHANDLES);
88} 85}
89 86
90bool OGlobalSettings::changeCursorOverIcon() 87bool OGlobalSettings::changeCursorOverIcon()
91{ 88{
92 OConfig *c = OGlobal::config(); 89 OConfig *c = OGlobal::config();
93 OConfigGroupSaver cgs( c, "OPIE" ); 90 OConfigGroupSaver cgs( c, "OPIE" );
94 return c->readBoolEntry("ChangeCursor", OPIE_DEFAULT_CHANGECURSOR); 91 return c->readBoolEntry("ChangeCursor", OPIE_DEFAULT_CHANGECURSOR);
95} 92}
96 93
97bool OGlobalSettings::visualActivate() 94bool OGlobalSettings::visualActivate()
98{ 95{
99 OConfig *c = OGlobal::config(); 96 OConfig *c = OGlobal::config();
100 OConfigGroupSaver cgs( c, "OPIE" ); 97 OConfigGroupSaver cgs( c, "OPIE" );
101 return c->readBoolEntry("VisualActivate", OPIE_DEFAULT_VISUAL_ACTIVATE); 98 return c->readBoolEntry("VisualActivate", OPIE_DEFAULT_VISUAL_ACTIVATE);
102} 99}
103 100
104unsigned int OGlobalSettings::visualActivateSpeed() 101unsigned int OGlobalSettings::visualActivateSpeed()
105{ 102{
106 OConfig *c = OGlobal::config(); 103 OConfig *c = OGlobal::config();
107 OConfigGroupSaver cgs( c, "OPIE" ); 104 OConfigGroupSaver cgs( c, "OPIE" );
108 return 105 return
109 c->readNumEntry( 106 c->readNumEntry(
110 "VisualActivateSpeed", 107 "VisualActivateSpeed",
111 OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED 108 OPIE_DEFAULT_VISUAL_ACTIVATE_SPEED
112 ); 109 );
113} 110}
114 111
115int OGlobalSettings::autoSelectDelay() 112int OGlobalSettings::autoSelectDelay()
116{ 113{
117 OConfig *c = OGlobal::config(); 114 OConfig *c = OGlobal::config();
118 OConfigGroupSaver cgs( c, "OPIE" ); 115 OConfigGroupSaver cgs( c, "OPIE" );
119 return c->readNumEntry("AutoSelectDelay", OPIE_DEFAULT_AUTOSELECTDELAY); 116 return c->readNumEntry("AutoSelectDelay", OPIE_DEFAULT_AUTOSELECTDELAY);
120} 117}
121 118
122OGlobalSettings::Completion OGlobalSettings::completionMode() 119OGlobalSettings::Completion OGlobalSettings::completionMode()
123{ 120{
124 int completion; 121 int completion;
125 OConfig *c = OGlobal::config(); 122 OConfig *c = OGlobal::config();
126 OConfigGroupSaver cgs( c, "General" ); 123 OConfigGroupSaver cgs( c, "General" );
127 completion = c->readNumEntry("completionMode", -1); 124 completion = c->readNumEntry("completionMode", -1);
128 if ((completion < (int) CompletionNone) || 125 if ((completion < (int) CompletionNone) ||
129 (completion > (int) CompletionPopupAuto)) 126 (completion > (int) CompletionPopupAuto))
130 { 127 {
131 completion = (int) CompletionPopup; // Default 128 completion = (int) CompletionPopup; // Default
132 } 129 }
133 return (Completion) completion; 130 return (Completion) completion;
134} 131}
135 132
136 133
137bool OGlobalSettings::showContextMenusOnPress () 134bool OGlobalSettings::showContextMenusOnPress ()
138{ 135{
139 OConfig *c = OGlobal::config(); 136 OConfig *c = OGlobal::config();
140 OConfigGroupSaver cgs (c, "ContextMenus"); 137 OConfigGroupSaver cgs (c, "ContextMenus");
diff --git a/libopie2/opiecore/oprocctrl.cpp b/libopie2/opiecore/oprocctrl.cpp
index b3d57c8..0403526 100644
--- a/libopie2/opiecore/oprocctrl.cpp
+++ b/libopie2/opiecore/oprocctrl.cpp
@@ -1,138 +1,137 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) 2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19// 19//
20// KPROCESSCONTROLLER -- A helper class for KProcess 20// KPROCESSCONTROLLER -- A helper class for KProcess
21// 21//
22// version 0.3.1, Jan, 8th 1997 22// version 0.3.1, Jan, 8th 1997
23// 23//
24// (C) Christian Czezatke 24// (C) Christian Czezatke
25// e9025461@student.tuwien.ac.at 25// e9025461@student.tuwien.ac.at
26// Ported by Holger Freyther 26// Ported by Holger Freyther
27// 27//
28 28
29//#include <config.h> 29//#include <config.h>
30 30
31#include <sys/types.h> 31#include <sys/types.h>
32#include <sys/socket.h> 32#include <sys/socket.h>
33 33
34#include <errno.h> 34#include <errno.h>
35#include <fcntl.h> 35#include <fcntl.h>
36#include <stdio.h> 36#include <stdio.h>
37#include <string.h> 37#include <string.h>
38#include <unistd.h> 38#include <unistd.h>
39#include <assert.h> 39#include <assert.h>
40 40
41#include <qsocketnotifier.h> 41#include <qsocketnotifier.h>
42#include "oprocess.h"
43#include "oprocctrl.h" 42#include "oprocctrl.h"
44 43
45OProcessController *OProcessController::theOProcessController = 0; 44OProcessController *OProcessController::theOProcessController = 0;
46 45
47struct sigaction OProcessController::oldChildHandlerData; 46struct sigaction OProcessController::oldChildHandlerData;
48bool OProcessController::handlerSet = false; 47bool OProcessController::handlerSet = false;
49 48
50OProcessController::OProcessController() 49OProcessController::OProcessController()
51{ 50{
52 assert( theOProcessController == 0 ); 51 assert( theOProcessController == 0 );
53 52
54 if (0 > pipe(fd)) 53 if (0 > pipe(fd))
55 printf(strerror(errno)); 54 printf(strerror(errno));
56 55
57 notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read); 56 notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read);
58 notifier->setEnabled(true); 57 notifier->setEnabled(true);
59 QObject::connect(notifier, SIGNAL(activated(int)), 58 QObject::connect(notifier, SIGNAL(activated(int)),
60 this, SLOT(slotDoHousekeeping(int))); 59 this, SLOT(slotDoHousekeeping(int)));
61 connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()), 60 connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()),
62 SLOT( delayedChildrenCleanup())); 61 SLOT( delayedChildrenCleanup()));
63 62
64 theOProcessController = this; 63 theOProcessController = this;
65 64
66 setupHandlers(); 65 setupHandlers();
67} 66}
68 67
69 68
70void OProcessController::setupHandlers() 69void OProcessController::setupHandlers()
71{ 70{
72 if( handlerSet ) 71 if( handlerSet )
73 return; 72 return;
74 struct sigaction act; 73 struct sigaction act;
75 act.sa_handler=theSigCHLDHandler; 74 act.sa_handler=theSigCHLDHandler;
76 sigemptyset(&(act.sa_mask)); 75 sigemptyset(&(act.sa_mask));
77 sigaddset(&(act.sa_mask), SIGCHLD); 76 sigaddset(&(act.sa_mask), SIGCHLD);
78 // Make sure we don't block this signal. gdb tends to do that :-( 77 // Make sure we don't block this signal. gdb tends to do that :-(
79 sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0); 78 sigprocmask(SIG_UNBLOCK, &(act.sa_mask), 0);
80 79
81 act.sa_flags = SA_NOCLDSTOP; 80 act.sa_flags = SA_NOCLDSTOP;
82 81
83 // CC: take care of SunOS which automatically restarts interrupted system 82 // CC: take care of SunOS which automatically restarts interrupted system
84 // calls (and thus does not have SA_RESTART) 83 // calls (and thus does not have SA_RESTART)
85 84
86#ifdef SA_RESTART 85#ifdef SA_RESTART
87 act.sa_flags |= SA_RESTART; 86 act.sa_flags |= SA_RESTART;
88#endif 87#endif
89 88
90 sigaction( SIGCHLD, &act, &oldChildHandlerData ); 89 sigaction( SIGCHLD, &act, &oldChildHandlerData );
91 90
92 act.sa_handler=SIG_IGN; 91 act.sa_handler=SIG_IGN;
93 sigemptyset(&(act.sa_mask)); 92 sigemptyset(&(act.sa_mask));
94 sigaddset(&(act.sa_mask), SIGPIPE); 93 sigaddset(&(act.sa_mask), SIGPIPE);
95 act.sa_flags = 0; 94 act.sa_flags = 0;
96 sigaction( SIGPIPE, &act, 0L); 95 sigaction( SIGPIPE, &act, 0L);
97 handlerSet = true; 96 handlerSet = true;
98} 97}
99 98
100void OProcessController::resetHandlers() 99void OProcessController::resetHandlers()
101{ 100{
102 if( !handlerSet ) 101 if( !handlerSet )
103 return; 102 return;
104 sigaction( SIGCHLD, &oldChildHandlerData, 0 ); 103 sigaction( SIGCHLD, &oldChildHandlerData, 0 );
105 // there should be no problem with SIGPIPE staying SIG_IGN 104 // there should be no problem with SIGPIPE staying SIG_IGN
106 handlerSet = false; 105 handlerSet = false;
107} 106}
108 107
109// block SIGCHLD handler, because it accesses processList 108// block SIGCHLD handler, because it accesses processList
110void OProcessController::addOProcess( OProcess* p ) 109void OProcessController::addOProcess( OProcess* p )
111{ 110{
112 sigset_t newset, oldset; 111 sigset_t newset, oldset;
113 sigemptyset( &newset ); 112 sigemptyset( &newset );
114 sigaddset( &newset, SIGCHLD ); 113 sigaddset( &newset, SIGCHLD );
115 sigprocmask( SIG_BLOCK, &newset, &oldset ); 114 sigprocmask( SIG_BLOCK, &newset, &oldset );
116 processList.append( p ); 115 processList.append( p );
117 sigprocmask( SIG_SETMASK, &oldset, 0 ); 116 sigprocmask( SIG_SETMASK, &oldset, 0 );
118} 117}
119 118
120void OProcessController::removeOProcess( OProcess* p ) 119void OProcessController::removeOProcess( OProcess* p )
121{ 120{
122 sigset_t newset, oldset; 121 sigset_t newset, oldset;
123 sigemptyset( &newset ); 122 sigemptyset( &newset );
124 sigaddset( &newset, SIGCHLD ); 123 sigaddset( &newset, SIGCHLD );
125 sigprocmask( SIG_BLOCK, &newset, &oldset ); 124 sigprocmask( SIG_BLOCK, &newset, &oldset );
126 processList.remove( p ); 125 processList.remove( p );
127 sigprocmask( SIG_SETMASK, &oldset, 0 ); 126 sigprocmask( SIG_SETMASK, &oldset, 0 );
128} 127}
129 128
130//using a struct which contains both the pid and the status makes it easier to write 129//using a struct which contains both the pid and the status makes it easier to write
131//and read the data into the pipe 130//and read the data into the pipe
132//especially this solves a problem which appeared on my box where slotDoHouseKeeping() received 131//especially this solves a problem which appeared on my box where slotDoHouseKeeping() received
133//only 4 bytes (with some debug output around the write()'s it received all 8 bytes) 132//only 4 bytes (with some debug output around the write()'s it received all 8 bytes)
134//don't know why this happened, but when writing all 8 bytes at once it works here, aleXXX 133//don't know why this happened, but when writing all 8 bytes at once it works here, aleXXX
135struct waitdata 134struct waitdata
136{ 135{
137 pid_t pid; 136 pid_t pid;
138 int status; 137 int status;
diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp
index 83677aa..0a361a1 100644
--- a/libopie2/opiecore/oprocess.cpp
+++ b/libopie2/opiecore/oprocess.cpp
@@ -1,138 +1,136 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3             Copyright (C) 2002-2004 Holger Freyther <zecke@handhelds.org> 3             Copyright (C) 2002-2004 Holger Freyther <zecke@handhelds.org>
4 and The Opie Team <opie-devel@handhelds.org> 4 and The Opie Team <opie-devel@handhelds.org>
5 =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at) 5 =. Based on KProcess (C) 1997 Christian Czezatke (e9025461@student.tuwien.ac.at)
6 .=l. 6 .=l.
7          .>+-= 7          .>+-=
8_;:,     .>    :=|. This program is free software; you can 8_;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12- .   .-<_>     .<> Foundation; either version 2 of the License, 12- .   .-<_>     .<> Foundation; either version 2 of the License,
13    ._= =}       : or (at your option) any later version. 13    ._= =}       : or (at your option) any later version.
14   .%`+i>       _;_. 14   .%`+i>       _;_.
15   .i_,=:_.      -<s. This program is distributed in the hope that 15   .i_,=:_.      -<s. This program is distributed in the hope that
16    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17   : ..    .:,     . . . without even the implied warranty of 17   : ..    .:,     . . . without even the implied warranty of
18   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22:     =  ...= . :.=- 22:     =  ...= . :.=-
23-.   .:....=;==+<; You should have received a copy of the GNU 23-.   .:....=;==+<; You should have received a copy of the GNU
24 -_. . .   )=.  = Library General Public License along with 24 -_. . .   )=.  = Library General Public License along with
25   --        :-=` this library; see the file COPYING.LIB. 25   --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include "oprocctrl.h" 31#include "oprocctrl.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/oprocess.h> 34#include <opie2/oprocess.h>
35 35
36/* QT */ 36/* QT */
37 37
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qdir.h> 39#include <qdir.h>
40#include <qfile.h>
41#include <qmap.h> 40#include <qmap.h>
42#include <qregexp.h>
43#include <qsocketnotifier.h> 41#include <qsocketnotifier.h>
44#include <qtextstream.h> 42#include <qtextstream.h>
45 43
46/* STD */ 44/* STD */
47#include <errno.h> 45#include <errno.h>
48#include <fcntl.h> 46#include <fcntl.h>
49#include <pwd.h> 47#include <pwd.h>
50#include <stdlib.h> 48#include <stdlib.h>
51#include <signal.h> 49#include <signal.h>
52#include <stdio.h> 50#include <stdio.h>
53#include <string.h> 51#include <string.h>
54#include <sys/time.h> 52#include <sys/time.h>
55#include <sys/types.h> 53#include <sys/types.h>
56#include <sys/stat.h> 54#include <sys/stat.h>
57#include <sys/socket.h> 55#include <sys/socket.h>
58#include <unistd.h> 56#include <unistd.h>
59#ifdef HAVE_SYS_SELECT_H 57#ifdef HAVE_SYS_SELECT_H
60#include <sys/select.h> 58#include <sys/select.h>
61#endif 59#endif
62#ifdef HAVE_INITGROUPS 60#ifdef HAVE_INITGROUPS
63#include <grp.h> 61#include <grp.h>
64#endif 62#endif
65 63
66class OProcessPrivate 64class OProcessPrivate
67{ 65{
68public: 66public:
69 OProcessPrivate() : useShell( false ) 67 OProcessPrivate() : useShell( false )
70 { } 68 { }
71 69
72 bool useShell; 70 bool useShell;
73 QMap<QString, QString> env; 71 QMap<QString, QString> env;
74 QString wd; 72 QString wd;
75 QCString shell; 73 QCString shell;
76}; 74};
77 75
78 76
79OProcess::OProcess( QObject *parent, const char *name ) 77OProcess::OProcess( QObject *parent, const char *name )
80 : QObject( parent, name ) 78 : QObject( parent, name )
81{ 79{
82 init ( ); 80 init ( );
83} 81}
84 82
85OProcess::OProcess( const QString &arg0, QObject *parent, const char *name ) 83OProcess::OProcess( const QString &arg0, QObject *parent, const char *name )
86 : QObject( parent, name ) 84 : QObject( parent, name )
87{ 85{
88 init ( ); 86 init ( );
89 *this << arg0; 87 *this << arg0;
90} 88}
91 89
92OProcess::OProcess( const QStringList &args, QObject *parent, const char *name ) 90OProcess::OProcess( const QStringList &args, QObject *parent, const char *name )
93 : QObject( parent, name ) 91 : QObject( parent, name )
94{ 92{
95 init ( ); 93 init ( );
96 *this << args; 94 *this << args;
97} 95}
98 96
99void OProcess::init ( ) 97void OProcess::init ( )
100{ 98{
101 run_mode = NotifyOnExit; 99 run_mode = NotifyOnExit;
102 runs = false; 100 runs = false;
103 pid_ = 0; 101 pid_ = 0;
104 status = 0; 102 status = 0;
105 keepPrivs = false; 103 keepPrivs = false;
106 innot = 0; 104 innot = 0;
107 outnot = 0; 105 outnot = 0;
108 errnot = 0; 106 errnot = 0;
109 communication = NoCommunication; 107 communication = NoCommunication;
110 input_data = 0; 108 input_data = 0;
111 input_sent = 0; 109 input_sent = 0;
112 input_total = 0; 110 input_total = 0;
113 d = 0; 111 d = 0;
114 112
115 if ( 0 == OProcessController::theOProcessController ) 113 if ( 0 == OProcessController::theOProcessController )
116 { 114 {
117 ( void ) new OProcessController(); 115 ( void ) new OProcessController();
118 CHECK_PTR( OProcessController::theOProcessController ); 116 CHECK_PTR( OProcessController::theOProcessController );
119 } 117 }
120 118
121 OProcessController::theOProcessController->addOProcess( this ); 119 OProcessController::theOProcessController->addOProcess( this );
122 out[ 0 ] = out[ 1 ] = -1; 120 out[ 0 ] = out[ 1 ] = -1;
123 in[ 0 ] = in[ 1 ] = -1; 121 in[ 0 ] = in[ 1 ] = -1;
124 err[ 0 ] = err[ 1 ] = -1; 122 err[ 0 ] = err[ 1 ] = -1;
125} 123}
126 124
127void OProcess::setEnvironment( const QString &name, const QString &value ) 125void OProcess::setEnvironment( const QString &name, const QString &value )
128{ 126{
129 if ( !d ) 127 if ( !d )
130 d = new OProcessPrivate; 128 d = new OProcessPrivate;
131 d->env.insert( name, value ); 129 d->env.insert( name, value );
132} 130}
133 131
134void OProcess::setWorkingDirectory( const QString &dir ) 132void OProcess::setWorkingDirectory( const QString &dir )
135{ 133{
136 if ( !d ) 134 if ( !d )
137 d = new OProcessPrivate; 135 d = new OProcessPrivate;
138 d->wd = dir; 136 d->wd = dir;
diff --git a/libopie2/opiedb/osqlbackendmanager.cpp b/libopie2/opiedb/osqlbackendmanager.cpp
index 0f261b9..95ed77b 100644
--- a/libopie2/opiedb/osqlbackendmanager.cpp
+++ b/libopie2/opiedb/osqlbackendmanager.cpp
@@ -1,98 +1,97 @@
1#include <qdir.h> 1#include <qdir.h>
2#include <qfile.h>
3#include <qmap.h> 2#include <qmap.h>
4 3
5#include "osqlbackendmanager.h" 4#include "osqlbackendmanager.h"
6 5
7namespace { 6namespace {
8 class Config { 7 class Config {
9 typedef QMap<QString, QString> List; 8 typedef QMap<QString, QString> List;
10 public: 9 public:
11 Config( const QString& fileName ); 10 Config( const QString& fileName );
12 /** 11 /**
13 * Quite simple layout in nature 12 * Quite simple layout in nature
14 * BeginFile 13 * BeginFile
15 * Key = Value 14 * Key = Value
16 */ 15 */
17 bool load(); 16 bool load();
18 QString value( const QString& key ); 17 QString value( const QString& key );
19 private: 18 private:
20 List m_list; 19 List m_list;
21 QString m_fileName; 20 QString m_fileName;
22 }; 21 };
23 Config::Config( const QString& fileName ) 22 Config::Config( const QString& fileName )
24 : m_fileName( fileName ) { 23 : m_fileName( fileName ) {
25 } 24 }
26 25
27 bool Config::load() { 26 bool Config::load() {
28 if (!QFile::exists( m_fileName ) ) 27 if (!QFile::exists( m_fileName ) )
29 return false; 28 return false;
30 QFile file( m_fileName ); 29 QFile file( m_fileName );
31 if (!file.open(IO_ReadOnly ) ) 30 if (!file.open(IO_ReadOnly ) )
32 return false; 31 return false;
33 QStringList list = QStringList::split( '\n', file.readAll() ); 32 QStringList list = QStringList::split( '\n', file.readAll() );
34 QStringList::Iterator it; 33 QStringList::Iterator it;
35 QString line; 34 QString line;
36 for (it = list.begin(); it != list.end(); ++it ) { 35 for (it = list.begin(); it != list.end(); ++it ) {
37 line = (*it).stripWhiteSpace(); 36 line = (*it).stripWhiteSpace();
38 qWarning("Anonymous::Config:" + line ); 37 qWarning("Anonymous::Config:" + line );
39 QStringList test = QStringList::split(' ', line ); 38 QStringList test = QStringList::split(' ', line );
40 m_list.insert( test[0], test[2] ); 39 m_list.insert( test[0], test[2] );
41 } 40 }
42 return true; 41 return true;
43 } 42 }
44 QString Config::value( const QString& key ) { 43 QString Config::value( const QString& key ) {
45 return m_list[key]; 44 return m_list[key];
46 } 45 }
47}; 46};
48OSQLBackEndManager::OSQLBackEndManager( const QStringList& path ) 47OSQLBackEndManager::OSQLBackEndManager( const QStringList& path )
49 :m_path( path ) 48 :m_path( path )
50{ 49{
51} 50}
52OSQLBackEndManager::~OSQLBackEndManager() { 51OSQLBackEndManager::~OSQLBackEndManager() {
53} 52}
54/** 53/**
55 * scan dirs 54 * scan dirs
56 */ 55 */
57OSQLBackEnd::ValueList OSQLBackEndManager::scan() { 56OSQLBackEnd::ValueList OSQLBackEndManager::scan() {
58 OSQLBackEnd::ValueList list; 57 OSQLBackEnd::ValueList list;
59 if (!m_path.isEmpty() ) { 58 if (!m_path.isEmpty() ) {
60 QStringList::Iterator it; 59 QStringList::Iterator it;
61 for ( it = m_path.begin(); it != m_path.end(); ++it ) { 60 for ( it = m_path.begin(); it != m_path.end(); ++it ) {
62 list += scanDir( (*it) ); 61 list += scanDir( (*it) );
63 } 62 }
64 } 63 }
65 return list; 64 return list;
66} 65}
67/** 66/**
68 * scan a specified dir for *.osql 67 * scan a specified dir for *.osql
69 */ 68 */
70OSQLBackEnd::ValueList OSQLBackEndManager::scanDir( const QString& dirName ) { 69OSQLBackEnd::ValueList OSQLBackEndManager::scanDir( const QString& dirName ) {
71 OSQLBackEnd::ValueList list; 70 OSQLBackEnd::ValueList list;
72 QDir dir( dirName ); 71 QDir dir( dirName );
73 if (dir.exists() ) { 72 if (dir.exists() ) {
74 QStringList files = dir.entryList( "*.osql" ); 73 QStringList files = dir.entryList( "*.osql" );
75 QStringList::Iterator it; 74 QStringList::Iterator it;
76 for ( it = files.begin(); it != files.end(); ++it ) { 75 for ( it = files.begin(); it != files.end(); ++it ) {
77 list.append( file2backend( (*it) ) ); 76 list.append( file2backend( (*it) ) );
78 } 77 }
79 } 78 }
80 return list; 79 return list;
81} 80}
82 81
83/** 82/**
84 * read a config file and convert it to a OSQLBackEnd 83 * read a config file and convert it to a OSQLBackEnd
85 */ 84 */
86OSQLBackEnd OSQLBackEndManager::file2backend( const QString& file ) { 85OSQLBackEnd OSQLBackEndManager::file2backend( const QString& file ) {
87 OSQLBackEnd end; 86 OSQLBackEnd end;
88 qWarning("fileName: " + file ); 87 qWarning("fileName: " + file );
89 Config cfg( file ); 88 Config cfg( file );
90 if (cfg.load() ) { 89 if (cfg.load() ) {
91 end.setName( cfg.value( "Name") ); 90 end.setName( cfg.value( "Name") );
92 end.setVendor( cfg.value("Vendor") ); 91 end.setVendor( cfg.value("Vendor") );
93 end.setLicense( cfg.value("License") ); 92 end.setLicense( cfg.value("License") );
94 end.setLibrary( cfg.value("Library").local8Bit() ); 93 end.setLibrary( cfg.value("Library").local8Bit() );
95 end.setDefault( cfg.value("Default").toInt() ); 94 end.setDefault( cfg.value("Default").toInt() );
96 end.setPreference( cfg.value("Preference").toInt() ); 95 end.setPreference( cfg.value("Preference").toInt() );
97 } 96 }
98 return end; 97 return end;
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp
index b857534..6141504 100644
--- a/libopie2/opiedb/osqlitedriver.cpp
+++ b/libopie2/opiedb/osqlitedriver.cpp
@@ -1,127 +1,126 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 =. 4 =.
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
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 30
31#include "osqlresult.h"
32#include "osqlquery.h" 31#include "osqlquery.h"
33#include "osqlitedriver.h" 32#include "osqlitedriver.h"
34 33
35#include <opie2/odebug.h> 34#include <opie2/odebug.h>
36 35
37#include <stdlib.h> 36#include <stdlib.h>
38 37
39// fromLocal8Bit() does not work as expected. Thus it 38// fromLocal8Bit() does not work as expected. Thus it
40// is replaced by fromLatin1() (eilers) 39// is replaced by fromLatin1() (eilers)
41#define __BUGGY_LOCAL8BIT_ 40#define __BUGGY_LOCAL8BIT_
42 41
43 42
44namespace { 43namespace {
45 struct Query { 44 struct Query {
46 OSQLError::ValueList errors; 45 OSQLError::ValueList errors;
47 OSQLResultItem::ValueList items; 46 OSQLResultItem::ValueList items;
48 OSQLiteDriver *driver; 47 OSQLiteDriver *driver;
49 }; 48 };
50} 49}
51 50
52 51
53OSQLiteDriver::OSQLiteDriver( QLibrary *lib ) 52OSQLiteDriver::OSQLiteDriver( QLibrary *lib )
54 : OSQLDriver( lib ) 53 : OSQLDriver( lib )
55{ 54{
56 m_sqlite = 0l; 55 m_sqlite = 0l;
57} 56}
58 57
59 58
60OSQLiteDriver::~OSQLiteDriver() { 59OSQLiteDriver::~OSQLiteDriver() {
61 close(); 60 close();
62} 61}
63 62
64 63
65QString OSQLiteDriver::id()const { 64QString OSQLiteDriver::id()const {
66 return QString::fromLatin1("SQLite"); 65 return QString::fromLatin1("SQLite");
67} 66}
68 67
69void OSQLiteDriver::setUserName( const QString& ) {} 68void OSQLiteDriver::setUserName( const QString& ) {}
70 69
71 70
72void OSQLiteDriver::setPassword( const QString& ) {} 71void OSQLiteDriver::setPassword( const QString& ) {}
73 72
74 73
75void OSQLiteDriver::setUrl( const QString& url ) { 74void OSQLiteDriver::setUrl( const QString& url ) {
76 m_url = url; 75 m_url = url;
77} 76}
78 77
79 78
80void OSQLiteDriver::setOptions( const QStringList& ) { 79void OSQLiteDriver::setOptions( const QStringList& ) {
81} 80}
82 81
83 82
84/* 83/*
85 * try to open a db specified via setUrl 84 * try to open a db specified via setUrl
86 * and options 85 * and options
87 */ 86 */
88bool OSQLiteDriver::open() { 87bool OSQLiteDriver::open() {
89 char *error; 88 char *error;
90 odebug << "OSQLiteDriver::open: about to open" << oendl; 89 odebug << "OSQLiteDriver::open: about to open" << oendl;
91 m_sqlite = sqlite_open(m_url.local8Bit(), 90 m_sqlite = sqlite_open(m_url.local8Bit(),
92 0, 91 0,
93 &error ); 92 &error );
94 93
95 /* failed to open */ 94 /* failed to open */
96 if (m_sqlite == 0l ) { 95 if (m_sqlite == 0l ) {
97 // FIXME set the last error 96 // FIXME set the last error
98 owarn << "OSQLiteDriver::open: " << error << oendl; 97 owarn << "OSQLiteDriver::open: " << error << oendl;
99 free( error ); 98 free( error );
100 return false; 99 return false;
101 } 100 }
102 return true; 101 return true;
103} 102}
104 103
105 104
106/* close the db 105/* close the db
107 * sqlite closes them without 106 * sqlite closes them without
108 * telling failure or success 107 * telling failure or success
109 */ 108 */
110bool OSQLiteDriver::close() { 109bool OSQLiteDriver::close() {
111 if (m_sqlite ) 110 if (m_sqlite )
112 sqlite_close( m_sqlite ), m_sqlite=0l; 111 sqlite_close( m_sqlite ), m_sqlite=0l;
113 112
114 return true; 113 return true;
115} 114}
116 115
117 116
118/* Query */ 117/* Query */
119OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { 118OSQLResult OSQLiteDriver::query( OSQLQuery* qu) {
120 if ( !m_sqlite ) { 119 if ( !m_sqlite ) {
121 // FIXME set error code 120 // FIXME set error code
122 OSQLResult result( OSQLResult::Failure ); 121 OSQLResult result( OSQLResult::Failure );
123 return result; 122 return result;
124 } 123 }
125 Query query; 124 Query query;
126 query.driver = this; 125 query.driver = this;
127 char *err; 126 char *err;
diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp
index b0fea04..766ebe1 100644
--- a/libopie2/opiedb/osqlmanager.cpp
+++ b/libopie2/opiedb/osqlmanager.cpp
@@ -1,83 +1,81 @@
1 1
2#include <stdlib.h> 2#include <stdlib.h>
3 3
4#include "osqlbackend.h"
5#include "osqldriver.h"
6#include "osqlmanager.h" 4#include "osqlmanager.h"
7#include "osqlbackendmanager.h" 5#include "osqlbackendmanager.h"
8#include "osqlitedriver.h" 6#include "osqlitedriver.h"
9 7
10OSQLManager::OSQLManager() { 8OSQLManager::OSQLManager() {
11} 9}
12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { 10OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
13 m_list.clear(); 11 m_list.clear();
14 QString opie = QString::fromLatin1( getenv("OPIEDIR") ); 12 QString opie = QString::fromLatin1( getenv("OPIEDIR") );
15 QString qpe = QString::fromLatin1( getenv("QPEDIR") ); 13 QString qpe = QString::fromLatin1( getenv("QPEDIR") );
16 14
17 if ( !m_path.contains(opie) && !opie.isEmpty() ) 15 if ( !m_path.contains(opie) && !opie.isEmpty() )
18 m_path << opie; 16 m_path << opie;
19 if ( !m_path.contains(qpe) && !qpe.isEmpty() ) 17 if ( !m_path.contains(qpe) && !qpe.isEmpty() )
20 m_path << qpe; 18 m_path << qpe;
21 19
22 OSQLBackEndManager mng( m_path ); 20 OSQLBackEndManager mng( m_path );
23 m_list = mng.scan(); 21 m_list = mng.scan();
24 m_list += builtIn(); 22 m_list += builtIn();
25 23
26 return m_list; 24 return m_list;
27} 25}
28/* 26/*
29 * loading dso's is currently not enabled due problems with QLibrary 27 * loading dso's is currently not enabled due problems with QLibrary
30 * beeing in libqpe and not libqte 28 * beeing in libqpe and not libqte
31 */ 29 */
32OSQLDriver* OSQLManager::load( const QString& name ) { 30OSQLDriver* OSQLManager::load( const QString& name ) {
33 OSQLDriver* driver = 0l; 31 OSQLDriver* driver = 0l;
34 32
35 if ( name == "SQLite" ) { 33 if ( name == "SQLite" ) {
36 driver = new OSQLiteDriver(); 34 driver = new OSQLiteDriver();
37 } 35 }
38 return driver; 36 return driver;
39} 37}
40/* 38/*
41 * same as above 39 * same as above
42 */ 40 */
43OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { 41OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) {
44 OSQLDriver *driver = 0l; 42 OSQLDriver *driver = 0l;
45 if ( end.library() == "builtin" && 43 if ( end.library() == "builtin" &&
46 end.name() == "SQLite" ) 44 end.name() == "SQLite" )
47 driver = new OSQLiteDriver(); 45 driver = new OSQLiteDriver();
48 46
49 return driver; 47 return driver;
50} 48}
51/* 49/*
52 * let's find the a default with the highes preference 50 * let's find the a default with the highes preference
53 */ 51 */
54OSQLDriver* OSQLManager::standard() { 52OSQLDriver* OSQLManager::standard() {
55 OSQLDriver* driver =0l; 53 OSQLDriver* driver =0l;
56 if ( m_list.isEmpty() ) queryBackEnd(); 54 if ( m_list.isEmpty() ) queryBackEnd();
57 OSQLBackEnd::ValueList::Iterator it; 55 OSQLBackEnd::ValueList::Iterator it;
58 OSQLBackEnd back; 56 OSQLBackEnd back;
59 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 57 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
60 if ( (*it).isDefault() && 58 if ( (*it).isDefault() &&
61 back.preference() < (*it).preference() ) { 59 back.preference() < (*it).preference() ) {
62 back = (*it); 60 back = (*it);
63 } 61 }
64 } 62 }
65 driver = load( back ); 63 driver = load( back );
66 return driver; 64 return driver;
67} 65}
68void OSQLManager::registerPath( const QString& path ) { 66void OSQLManager::registerPath( const QString& path ) {
69 m_path << path; 67 m_path << path;
70} 68}
71bool OSQLManager::unregisterPath( const QString& path ) { 69bool OSQLManager::unregisterPath( const QString& path ) {
72 m_path.remove( path ); 70 m_path.remove( path );
73 return true; 71 return true;
74} 72}
75OSQLBackEnd::ValueList OSQLManager::builtIn()const { 73OSQLBackEnd::ValueList OSQLManager::builtIn()const {
76 OSQLBackEnd::ValueList list; 74 OSQLBackEnd::ValueList list;
77 // create the OSQLiteBackend 75 // create the OSQLiteBackend
78 OSQLBackEnd back("SQLite","Opie e.V.","GPL", "builtin" ); 76 OSQLBackEnd back("SQLite","Opie e.V.","GPL", "builtin" );
79 back.setDefault( true ); 77 back.setDefault( true );
80 back.setPreference( 50 ); 78 back.setPreference( 50 );
81 list.append( back ); 79 list.append( back );
82 return list; 80 return list;
83} 81}
diff --git a/libopie2/opiedb/osqlresult.cpp b/libopie2/opiedb/osqlresult.cpp
index 490fb45..42da356 100644
--- a/libopie2/opiedb/osqlresult.cpp
+++ b/libopie2/opiedb/osqlresult.cpp
@@ -1,98 +1,97 @@
1 1
2#include "osqlquery.h"
3#include "osqlresult.h" 2#include "osqlresult.h"
4 3
5OSQLResultItem::OSQLResultItem( const TableString& string, 4OSQLResultItem::OSQLResultItem( const TableString& string,
6 const TableInt& Int) 5 const TableInt& Int)
7 : m_string( string ), m_int( Int ) 6 : m_string( string ), m_int( Int )
8{ 7{
9 8
10} 9}
11OSQLResultItem::~OSQLResultItem() { 10OSQLResultItem::~OSQLResultItem() {
12} 11}
13OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) { 12OSQLResultItem::OSQLResultItem( const OSQLResultItem& item) {
14 *this = item; 13 *this = item;
15} 14}
16OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) { 15OSQLResultItem &OSQLResultItem::operator=( const OSQLResultItem& other) {
17 m_string = other.m_string; 16 m_string = other.m_string;
18 m_int = other.m_int; 17 m_int = other.m_int;
19 return *this; 18 return *this;
20} 19}
21OSQLResultItem::TableString OSQLResultItem::tableString()const{ 20OSQLResultItem::TableString OSQLResultItem::tableString()const{
22 return m_string; 21 return m_string;
23} 22}
24OSQLResultItem::TableInt OSQLResultItem::tableInt()const { 23OSQLResultItem::TableInt OSQLResultItem::tableInt()const {
25 return m_int; 24 return m_int;
26} 25}
27QString OSQLResultItem::data( const QString& columnName, bool *ok ) { 26QString OSQLResultItem::data( const QString& columnName, bool *ok ) {
28 TableString::Iterator it = m_string.find( columnName ); 27 TableString::Iterator it = m_string.find( columnName );
29 28
30 /* if found */ 29 /* if found */
31 if ( it != m_string.end() ) { 30 if ( it != m_string.end() ) {
32 if ( ok ) *ok = true; 31 if ( ok ) *ok = true;
33 return it.data(); 32 return it.data();
34 }else{ 33 }else{
35 if ( ok ) *ok = false; 34 if ( ok ) *ok = false;
36 return QString::null; 35 return QString::null;
37 } 36 }
38 37
39} 38}
40QString OSQLResultItem::data( int column, bool *ok ) { 39QString OSQLResultItem::data( int column, bool *ok ) {
41 TableInt::Iterator it = m_int.find( column ); 40 TableInt::Iterator it = m_int.find( column );
42 41
43 /* if found */ 42 /* if found */
44 if ( it != m_int.end() ) { 43 if ( it != m_int.end() ) {
45 if ( ok ) *ok = true; 44 if ( ok ) *ok = true;
46 return it.data(); 45 return it.data();
47 }else{ 46 }else{
48 if ( ok ) *ok = false; 47 if ( ok ) *ok = false;
49 return QString::null; 48 return QString::null;
50 } 49 }
51} 50}
52/* 51/*
53 * DateFormat is 'YYYY-MM-DD' 52 * DateFormat is 'YYYY-MM-DD'
54 */ 53 */
55QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) { 54QDate OSQLResultItem::dataToDate( const QString& column, bool *ok ) {
56 QDate date = QDate::currentDate(); 55 QDate date = QDate::currentDate();
57 QString str = data( column, ok ); 56 QString str = data( column, ok );
58 if (!str.isEmpty() ) { 57 if (!str.isEmpty() ) {
59 ;// convert 58 ;// convert
60 } 59 }
61 return date; 60 return date;
62} 61}
63QDate OSQLResultItem::dataToDate( int column, bool *ok ) { 62QDate OSQLResultItem::dataToDate( int column, bool *ok ) {
64 QDate date = QDate::currentDate(); 63 QDate date = QDate::currentDate();
65 QString str = data( column, ok ); 64 QString str = data( column, ok );
66 if (!str.isEmpty() ) { 65 if (!str.isEmpty() ) {
67 ;// convert 66 ;// convert
68 } 67 }
69 return date; 68 return date;
70 69
71} 70}
72QDateTime OSQLResultItem::dataToDateTime( const QString& column, bool *ok ) { 71QDateTime OSQLResultItem::dataToDateTime( const QString& column, bool *ok ) {
73 QDateTime time = QDateTime::currentDateTime(); 72 QDateTime time = QDateTime::currentDateTime();
74 return time; 73 return time;
75} 74}
76QDateTime OSQLResultItem::dataToDateTime( int column, bool *ok ) { 75QDateTime OSQLResultItem::dataToDateTime( int column, bool *ok ) {
77 QDateTime time = QDateTime::currentDateTime(); 76 QDateTime time = QDateTime::currentDateTime();
78 return time; 77 return time;
79} 78}
80 79
81OSQLResult::OSQLResult( enum State state, 80OSQLResult::OSQLResult( enum State state,
82 const OSQLResultItem::ValueList& list, 81 const OSQLResultItem::ValueList& list,
83 const OSQLError::ValueList& error ) 82 const OSQLError::ValueList& error )
84 : m_state( state ), m_list( list ), m_error( error ) 83 : m_state( state ), m_list( list ), m_error( error )
85{ 84{
86 85
87} 86}
88OSQLResult::~OSQLResult() { 87OSQLResult::~OSQLResult() {
89 88
90} 89}
91OSQLResult::State OSQLResult::state()const { 90OSQLResult::State OSQLResult::state()const {
92 return m_state; 91 return m_state;
93} 92}
94void OSQLResult::setState( OSQLResult::State state ) { 93void OSQLResult::setState( OSQLResult::State state ) {
95 m_state = state; 94 m_state = state;
96} 95}
97OSQLError::ValueList OSQLResult::errors()const { 96OSQLError::ValueList OSQLResult::errors()const {
98 return m_error; 97 return m_error;
diff --git a/libopie2/opiemm/osoundsystem.cpp b/libopie2/opiemm/osoundsystem.cpp
index ca63389..51e088c 100644
--- a/libopie2/opiemm/osoundsystem.cpp
+++ b/libopie2/opiemm/osoundsystem.cpp
@@ -1,139 +1,138 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 4              (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include <opie2/osoundsystem.h> 32#include <opie2/osoundsystem.h>
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34 34
35#include <errno.h> 35#include <errno.h>
36#include <fcntl.h> 36#include <fcntl.h>
37#include <string.h> 37#include <string.h>
38#include <sys/ioctl.h> 38#include <sys/ioctl.h>
39#include <sys/types.h> 39#include <sys/types.h>
40#include <sys/soundcard.h> 40#include <sys/soundcard.h>
41#include <sys/stat.h> 41#include <sys/stat.h>
42 42
43#include <qstringlist.h>
44 43
45/*====================================================================================== 44/*======================================================================================
46 * OSoundSystem 45 * OSoundSystem
47 *======================================================================================*/ 46 *======================================================================================*/
48 47
49OSoundSystem* OSoundSystem::_instance = 0; 48OSoundSystem* OSoundSystem::_instance = 0;
50 49
51OSoundSystem::OSoundSystem() 50OSoundSystem::OSoundSystem()
52{ 51{
53 odebug << "OSoundSystem::OSoundSystem()" << oendl; 52 odebug << "OSoundSystem::OSoundSystem()" << oendl;
54 synchronize(); 53 synchronize();
55} 54}
56 55
57void OSoundSystem::synchronize() 56void OSoundSystem::synchronize()
58{ 57{
59 // gather available interfaces by inspecting /dev 58 // gather available interfaces by inspecting /dev
60 //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices 59 //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
61 //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices 60 //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices
62 61
63 _interfaces.clear(); 62 _interfaces.clear();
64 _interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) ); 63 _interfaces.insert( "soundcard", new OSoundCard( this, "soundcard" ) );
65 64
66 65
67 /* 66 /*
68 67
69 QString str; 68 QString str;
70 QFile f( "/dev/sound" ); 69 QFile f( "/dev/sound" );
71 bool hasFile = f.open( IO_ReadOnly ); 70 bool hasFile = f.open( IO_ReadOnly );
72 if ( !hasFile ) 71 if ( !hasFile )
73 { 72 {
74 odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl; 73 odebug << "OSoundSystem: /dev/sound not existing. No sound devices available" << oendl;
75 return; 74 return;
76 } 75 }
77 QTextStream s( &f ); 76 QTextStream s( &f );
78 s.readLine(); 77 s.readLine();
79 s.readLine(); 78 s.readLine();
80 while ( !s.atEnd() ) 79 while ( !s.atEnd() )
81 { 80 {
82 s >> str; 81 s >> str;
83 str.truncate( str.find( ':' ) ); 82 str.truncate( str.find( ':' ) );
84 qDebug( "OSoundSystem: found interface '%s'", (const char*) str ); 83 qDebug( "OSoundSystem: found interface '%s'", (const char*) str );
85 OAudioInterface* iface; 84 OAudioInterface* iface;
86 iface = new OAudioInterface( this, (const char*) str ); 85 iface = new OAudioInterface( this, (const char*) str );
87 86
88 _interfaces.insert( str, iface ); 87 _interfaces.insert( str, iface );
89 s.readLine(); 88 s.readLine();
90 } 89 }
91*/ 90*/
92} 91}
93 92
94 93
95int OSoundSystem::count() const 94int OSoundSystem::count() const
96{ 95{
97 return _interfaces.count(); 96 return _interfaces.count();
98} 97}
99 98
100 99
101OSoundCard* OSoundSystem::card( const QString& iface ) const 100OSoundCard* OSoundSystem::card( const QString& iface ) const
102{ 101{
103 return _interfaces[iface]; 102 return _interfaces[iface];
104} 103}
105 104
106 105
107OSoundSystem* OSoundSystem::instance() 106OSoundSystem* OSoundSystem::instance()
108{ 107{
109 if ( !_instance ) _instance = new OSoundSystem(); 108 if ( !_instance ) _instance = new OSoundSystem();
110 return _instance; 109 return _instance;
111} 110}
112 111
113 112
114OSoundSystem::CardIterator OSoundSystem::iterator() const 113OSoundSystem::CardIterator OSoundSystem::iterator() const
115{ 114{
116 return OSoundSystem::CardIterator( _interfaces ); 115 return OSoundSystem::CardIterator( _interfaces );
117} 116}
118 117
119 118
120/*====================================================================================== 119/*======================================================================================
121 * OSoundCard 120 * OSoundCard
122 *======================================================================================*/ 121 *======================================================================================*/
123 122
124OSoundCard::OSoundCard( QObject* parent, const char* name ) 123OSoundCard::OSoundCard( QObject* parent, const char* name )
125 :QObject( parent, name ), _audio( 0 ), _mixer( 0 ) 124 :QObject( parent, name ), _audio( 0 ), _mixer( 0 )
126{ 125{
127 odebug << "OSoundCard::OSoundCard()" << oendl; 126 odebug << "OSoundCard::OSoundCard()" << oendl;
128 init(); 127 init();
129} 128}
130 129
131 130
132OSoundCard::~OSoundCard() 131OSoundCard::~OSoundCard()
133{ 132{
134} 133}
135 134
136 135
137void OSoundCard::init() 136void OSoundCard::init()
138{ 137{
139 _audio = new OAudioInterface( this, "/dev/dsp" ); 138 _audio = new OAudioInterface( this, "/dev/dsp" );
diff --git a/libopie2/opienet/omanufacturerdb.cpp b/libopie2/opienet/omanufacturerdb.cpp
index 2da549c..b93b752 100644
--- a/libopie2/opienet/omanufacturerdb.cpp
+++ b/libopie2/opienet/omanufacturerdb.cpp
@@ -1,136 +1,135 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> 3              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 =. 4 =.
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
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 30
31#include "omanufacturerdb.h" 31#include "omanufacturerdb.h"
32 32
33#define OPIE_IMPROVE_GUI_LATENCY 1 33#define OPIE_IMPROVE_GUI_LATENCY 1
34 34
35/* OPIE */ 35/* OPIE */
36#include <opie2/odebug.h> 36#include <opie2/odebug.h>
37#ifdef OPIE_IMPROVE_GUI_LATENCY 37#ifdef OPIE_IMPROVE_GUI_LATENCY
38#include <qpe/global.h> 38#include <qpe/global.h>
39#endif 39#endif
40 40
41/* QT */ 41/* QT */
42#include <qapplication.h> 42#include <qapplication.h>
43#include <qstring.h>
44#include <qfile.h> 43#include <qfile.h>
45#include <qtextstream.h> 44#include <qtextstream.h>
46 45
47OManufacturerDB* OManufacturerDB::_instance = 0; 46OManufacturerDB* OManufacturerDB::_instance = 0;
48 47
49OManufacturerDB* OManufacturerDB::instance() 48OManufacturerDB* OManufacturerDB::instance()
50{ 49{
51 if ( !OManufacturerDB::_instance ) 50 if ( !OManufacturerDB::_instance )
52 { 51 {
53 odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl; 52 odebug << "OManufacturerDB::instance(): creating OManufacturerDB..." << oendl;
54 _instance = new OManufacturerDB(); 53 _instance = new OManufacturerDB();
55 } 54 }
56 return _instance; 55 return _instance;
57} 56}
58 57
59 58
60OManufacturerDB::OManufacturerDB() 59OManufacturerDB::OManufacturerDB()
61{ 60{
62 #ifdef OPIE_IMPROVE_GUI_LATENCY 61 #ifdef OPIE_IMPROVE_GUI_LATENCY
63 Global::statusMessage( "Reading Manufacturers..." ); 62 Global::statusMessage( "Reading Manufacturers..." );
64 #endif 63 #endif
65 QString filename( "/etc/manufacturers" ); 64 QString filename( "/etc/manufacturers" );
66 odebug << "OManufacturerDB: trying to read " << filename << oendl; 65 odebug << "OManufacturerDB: trying to read " << filename << oendl;
67 if ( !QFile::exists( filename ) ) 66 if ( !QFile::exists( filename ) )
68 { 67 {
69 filename = "/opt/QtPalmtop/etc/manufacturers"; 68 filename = "/opt/QtPalmtop/etc/manufacturers";
70 odebug << "OManufacturerDB: trying to read " << filename << oendl; 69 odebug << "OManufacturerDB: trying to read " << filename << oendl;
71 if ( !QFile::exists( filename ) ) 70 if ( !QFile::exists( filename ) )
72 { 71 {
73 filename = "/usr/share/wellenreiter/manufacturers"; 72 filename = "/usr/share/wellenreiter/manufacturers";
74 odebug << "OManufacturerDB: trying to read " << filename << oendl; 73 odebug << "OManufacturerDB: trying to read " << filename << oendl;
75 } 74 }
76 } 75 }
77 76
78 QFile file( filename ); 77 QFile file( filename );
79 bool hasFile = file.open( IO_ReadOnly ); 78 bool hasFile = file.open( IO_ReadOnly );
80 if (!hasFile) 79 if (!hasFile)
81 { 80 {
82 owarn << "OManufacturerDB: no valid manufacturer list found." << oendl; 81 owarn << "OManufacturerDB: no valid manufacturer list found." << oendl;
83 } 82 }
84 else 83 else
85 { 84 {
86 odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl; 85 odebug << "OManufacturerDB: found manufacturer list in " << filename << oendl;
87 QTextStream s( &file ); 86 QTextStream s( &file );
88 QString addr; 87 QString addr;
89 QString manu; 88 QString manu;
90 QString extManu; 89 QString extManu;
91 #ifdef OPIE_IMPROVE_GUI_LATENCY 90 #ifdef OPIE_IMPROVE_GUI_LATENCY
92 int counter = 0; 91 int counter = 0;
93 #endif 92 #endif
94 while (!s.atEnd()) 93 while (!s.atEnd())
95 { 94 {
96 s >> addr; 95 s >> addr;
97 s >> manu; 96 s >> manu;
98 s >> extManu; 97 s >> extManu;
99 98
100 manufacturers.insert( addr, manu ); 99 manufacturers.insert( addr, manu );
101 manufacturersExt.insert( addr, extManu ); 100 manufacturersExt.insert( addr, extManu );
102 // odebug << "OmanufacturerDB: parse '" << addr << "' as '" << manu << "' (" << extManu << ")" << oendl; 101 // odebug << "OmanufacturerDB: parse '" << addr << "' as '" << manu << "' (" << extManu << ")" << oendl;
103 #ifdef OPIE_IMPROVE_GUI_LATENCY 102 #ifdef OPIE_IMPROVE_GUI_LATENCY
104 counter++; 103 counter++;
105 if ( counter == 50 ) 104 if ( counter == 50 )
106 { 105 {
107 qApp->processEvents(); 106 qApp->processEvents();
108 counter = 0; 107 counter = 0;
109 } 108 }
110 #endif 109 #endif
111 } 110 }
112 odebug << "OManufacturerDB: manufacturer list completed." << oendl; 111 odebug << "OManufacturerDB: manufacturer list completed." << oendl;
113 #ifdef OPIE_IMPROVE_GUI_LATENCY 112 #ifdef OPIE_IMPROVE_GUI_LATENCY
114 Global::statusMessage( "Manufacturers Complete..." ); 113 Global::statusMessage( "Manufacturers Complete..." );
115 #endif 114 #endif
116 } 115 }
117} 116}
118 117
119 118
120OManufacturerDB::~OManufacturerDB() 119OManufacturerDB::~OManufacturerDB()
121{ 120{
122} 121}
123 122
124 123
125const QString& OManufacturerDB::lookup( const QString& macaddr ) const 124const QString& OManufacturerDB::lookup( const QString& macaddr ) const
126{ 125{
127 return manufacturers[macaddr.upper().left(8)]; 126 return manufacturers[macaddr.upper().left(8)];
128} 127}
129 128
130 129
131const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const 130const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const
132{ 131{
133 QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); 132 QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) );
134 return it == manufacturersExt.end() ? lookup( macaddr ) : *it; 133 return it == manufacturersExt.end() ? lookup( macaddr ) : *it;
135} 134}
136 135
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
index 0adba68..5d92b8f 100644
--- a/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/ocontactaccessbackend_xml.cpp
@@ -1,138 +1,136 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) 3 Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de)
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 * XML Backend for the OPIE-Contact Database. 30 * XML Backend for the OPIE-Contact Database.
31 */ 31 */
32 32
33#include <opie2/ocontactaccessbackend_xml.h> 33#include <opie2/ocontactaccessbackend_xml.h>
34 34
35#include <qasciidict.h> 35#include <qasciidict.h>
36#include <qdatetime.h>
37#include <qfile.h> 36#include <qfile.h>
38#include <qfileinfo.h> 37#include <qfileinfo.h>
39#include <qregexp.h> 38#include <qregexp.h>
40#include <qarray.h> 39#include <qarray.h>
41#include <qmap.h> 40#include <qmap.h>
42#include <qdatetime.h>
43 41
44#include <qpe/global.h> 42#include <qpe/global.h>
45 43
46#include <opie2/xmltree.h> 44#include <opie2/xmltree.h>
47#include <opie2/ocontactaccessbackend.h> 45#include <opie2/ocontactaccessbackend.h>
48#include <opie2/ocontactaccess.h> 46#include <opie2/ocontactaccess.h>
49 47
50#include <stdlib.h> 48#include <stdlib.h>
51#include <errno.h> 49#include <errno.h>
52 50
53using namespace Opie; 51using namespace Opie;
54 52
55 53
56namespace Opie { 54namespace Opie {
57OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ): 55OPimContactAccessBackend_XML::OPimContactAccessBackend_XML ( const QString& appname, const QString& filename ):
58 m_changed( false ) 56 m_changed( false )
59{ 57{
60 // Just m_contactlist should call delete if an entry 58 // Just m_contactlist should call delete if an entry
61 // is removed. 59 // is removed.
62 m_contactList.setAutoDelete( true ); 60 m_contactList.setAutoDelete( true );
63 m_uidToContact.setAutoDelete( false ); 61 m_uidToContact.setAutoDelete( false );
64 62
65 m_appName = appname; 63 m_appName = appname;
66 64
67 /* Set journalfile name ... */ 65 /* Set journalfile name ... */
68 m_journalName = getenv("HOME"); 66 m_journalName = getenv("HOME");
69 m_journalName +="/.abjournal" + appname; 67 m_journalName +="/.abjournal" + appname;
70 68
71 /* Expecting to access the default filename if nothing else is set */ 69 /* Expecting to access the default filename if nothing else is set */
72 if ( filename.isEmpty() ){ 70 if ( filename.isEmpty() ){
73 m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" ); 71 m_fileName = Global::applicationFileName( "addressbook","addressbook.xml" );
74 } else 72 } else
75 m_fileName = filename; 73 m_fileName = filename;
76 74
77 /* Load Database now */ 75 /* Load Database now */
78 load (); 76 load ();
79} 77}
80 78
81bool OPimContactAccessBackend_XML::save() 79bool OPimContactAccessBackend_XML::save()
82{ 80{
83 81
84 if ( !m_changed ) 82 if ( !m_changed )
85 return true; 83 return true;
86 84
87 QString strNewFile = m_fileName + ".new"; 85 QString strNewFile = m_fileName + ".new";
88 QFile f( strNewFile ); 86 QFile f( strNewFile );
89 if ( !f.open( IO_WriteOnly|IO_Raw ) ) 87 if ( !f.open( IO_WriteOnly|IO_Raw ) )
90 return false; 88 return false;
91 89
92 int total_written; 90 int total_written;
93 int idx_offset = 0; 91 int idx_offset = 0;
94 QString out; 92 QString out;
95 93
96 // Write Header 94 // Write Header
97 out = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>\n" 95 out = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>\n"
98 " <Groups>\n" 96 " <Groups>\n"
99 " </Groups>\n" 97 " </Groups>\n"
100 " <Contacts>\n"; 98 " <Contacts>\n";
101 QCString cstr = out.utf8(); 99 QCString cstr = out.utf8();
102 f.writeBlock( cstr.data(), cstr.length() ); 100 f.writeBlock( cstr.data(), cstr.length() );
103 idx_offset += cstr.length(); 101 idx_offset += cstr.length();
104 out = ""; 102 out = "";
105 103
106 // Write all contacts 104 // Write all contacts
107 QListIterator<OPimContact> it( m_contactList ); 105 QListIterator<OPimContact> it( m_contactList );
108 for ( ; it.current(); ++it ) { 106 for ( ; it.current(); ++it ) {
109 // qWarning(" Uid %d at Offset: %x", (*it)->uid(), idx_offset ); 107 // qWarning(" Uid %d at Offset: %x", (*it)->uid(), idx_offset );
110 out += "<Contact "; 108 out += "<Contact ";
111 (*it)->save( out ); 109 (*it)->save( out );
112 out += "/>\n"; 110 out += "/>\n";
113 cstr = out.utf8(); 111 cstr = out.utf8();
114 total_written = f.writeBlock( cstr.data(), cstr.length() ); 112 total_written = f.writeBlock( cstr.data(), cstr.length() );
115 idx_offset += cstr.length(); 113 idx_offset += cstr.length();
116 if ( total_written != int(cstr.length()) ) { 114 if ( total_written != int(cstr.length()) ) {
117 f.close(); 115 f.close();
118 QFile::remove( strNewFile ); 116 QFile::remove( strNewFile );
119 return false; 117 return false;
120 } 118 }
121 out = ""; 119 out = "";
122 } 120 }
123 out += " </Contacts>\n</AddressBook>\n"; 121 out += " </Contacts>\n</AddressBook>\n";
124 122
125 // Write Footer 123 // Write Footer
126 cstr = out.utf8(); 124 cstr = out.utf8();
127 total_written = f.writeBlock( cstr.data(), cstr.length() ); 125 total_written = f.writeBlock( cstr.data(), cstr.length() );
128 if ( total_written != int( cstr.length() ) ) { 126 if ( total_written != int( cstr.length() ) ) {
129 f.close(); 127 f.close();
130 QFile::remove( strNewFile ); 128 QFile::remove( strNewFile );
131 return false; 129 return false;
132 } 130 }
133 f.close(); 131 f.close();
134 132
135 // move the file over, I'm just going to use the system call 133 // move the file over, I'm just going to use the system call
136 // because, I don't feel like using QDir. 134 // because, I don't feel like using QDir.
137 if ( ::rename( strNewFile.latin1(), m_fileName.latin1() ) < 0 ) { 135 if ( ::rename( strNewFile.latin1(), m_fileName.latin1() ) < 0 ) {
138 qWarning( "problem renaming file %s to %s, errno: %d", 136 qWarning( "problem renaming file %s to %s, errno: %d",
diff --git a/libopie2/opiepim/core/opimcontact.cpp b/libopie2/opiepim/core/opimcontact.cpp
index a5df597..4a774e8 100644
--- a/libopie2/opiepim/core/opimcontact.cpp
+++ b/libopie2/opiepim/core/opimcontact.cpp
@@ -1,142 +1,138 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de> 3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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#define QTOPIA_INTERNAL_CONTACT_MRE 30#define QTOPIA_INTERNAL_CONTACT_MRE
31 31
32#include "opimcontact.h" 32#include "opimcontact.h"
33 33
34/* OPIE */ 34/* OPIE */
35#include <opie2/opimresolver.h> 35#include <opie2/opimresolver.h>
36#include <opie2/opimdateconversion.h> 36#include <opie2/opimdateconversion.h>
37#include <qpe/stringutil.h> 37#include <qpe/stringutil.h>
38#include <qpe/timestring.h> 38#include <qpe/timestring.h>
39#include <qpe/config.h> 39#include <qpe/config.h>
40 40
41/* QT */ 41/* QT */
42#include <qobject.h>
43#include <qregexp.h>
44#include <qstylesheet.h> 42#include <qstylesheet.h>
45#include <qfileinfo.h>
46#include <qmap.h>
47 43
48/* STD */ 44/* STD */
49#include <stdio.h> 45#include <stdio.h>
50 46
51/*! 47/*!
52 \class Contact contact.h 48 \class Contact contact.h
53 \brief The Contact class holds the data of an address book entry. 49 \brief The Contact class holds the data of an address book entry.
54 50
55 This data includes information the name of the person, contact 51 This data includes information the name of the person, contact
56 information, and business information such as deparment and job title. 52 information, and business information such as deparment and job title.
57 53
58 \ingroup qtopiaemb 54 \ingroup qtopiaemb
59 \ingroup qtopiadesktop 55 \ingroup qtopiadesktop
60*/ 56*/
61 57
62 58
63namespace Opie 59namespace Opie
64{ 60{
65/*! 61/*!
66 Creates a new, empty contact. 62 Creates a new, empty contact.
67*/ 63*/
68OPimContact::OPimContact():OPimRecord(), mMap(), d( 0 ) 64OPimContact::OPimContact():OPimRecord(), mMap(), d( 0 )
69{} 65{}
70 66
71/*! 67/*!
72 \internal 68 \internal
73 Creates a new contact. The properties of the contact are 69 Creates a new contact. The properties of the contact are
74 set from \a fromMap. 70 set from \a fromMap.
75*/ 71*/
76OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap( fromMap ), d( 0 ) 72OPimContact::OPimContact( const QMap<int, QString> &fromMap ):OPimRecord(), mMap( fromMap ), d( 0 )
77{ 73{
78 QString cats = mMap[ Qtopia::AddressCategory ]; 74 QString cats = mMap[ Qtopia::AddressCategory ];
79 if ( !cats.isEmpty() ) 75 if ( !cats.isEmpty() )
80 setCategories( idsFromString( cats ) ); 76 setCategories( idsFromString( cats ) );
81 77
82 QString uidStr = find( Qtopia::AddressUid ); 78 QString uidStr = find( Qtopia::AddressUid );
83 79
84 if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) ) 80 if ( uidStr.isEmpty() || ( uidStr.toInt() == 0 ) )
85 { 81 {
86 qWarning( "Invalid UID found. Generate new one.." ); 82 qWarning( "Invalid UID found. Generate new one.." );
87 setUid( uidGen().generate() ); 83 setUid( uidGen().generate() );
88 } 84 }
89 else 85 else
90 setUid( uidStr.toInt() ); 86 setUid( uidStr.toInt() );
91 87
92 // if ( !uidStr.isEmpty() ) 88 // if ( !uidStr.isEmpty() )
93 // setUid( uidStr.toInt() ); 89 // setUid( uidStr.toInt() );
94} 90}
95 91
96/*! 92/*!
97 Destroys a contact. 93 Destroys a contact.
98*/ 94*/
99OPimContact::~OPimContact() 95OPimContact::~OPimContact()
100{} 96{}
101 97
102/*! \fn void OPimContact::setTitle( const QString &str ) 98/*! \fn void OPimContact::setTitle( const QString &str )
103 Sets the title of the contact to \a str. 99 Sets the title of the contact to \a str.
104*/ 100*/
105 101
106/*! \fn void OPimContact::setFirstName( const QString &str ) 102/*! \fn void OPimContact::setFirstName( const QString &str )
107 Sets the first name of the contact to \a str. 103 Sets the first name of the contact to \a str.
108*/ 104*/
109 105
110/*! \fn void OPimContact::setMiddleName( const QString &str ) 106/*! \fn void OPimContact::setMiddleName( const QString &str )
111 Sets the middle name of the contact to \a str. 107 Sets the middle name of the contact to \a str.
112*/ 108*/
113 109
114/*! \fn void OPimContact::setLastName( const QString &str ) 110/*! \fn void OPimContact::setLastName( const QString &str )
115 Sets the last name of the contact to \a str. 111 Sets the last name of the contact to \a str.
116*/ 112*/
117 113
118/*! \fn void OPimContact::setSuffix( const QString &str ) 114/*! \fn void OPimContact::setSuffix( const QString &str )
119 Sets the suffix of the contact to \a str. 115 Sets the suffix of the contact to \a str.
120*/ 116*/
121 117
122/*! \fn void OPimContact::setFileAs( const QString &str ) 118/*! \fn void OPimContact::setFileAs( const QString &str )
123 Sets the contact to filed as \a str. 119 Sets the contact to filed as \a str.
124*/ 120*/
125 121
126/*! \fn void OPimContact::setDefaultEmail( const QString &str ) 122/*! \fn void OPimContact::setDefaultEmail( const QString &str )
127 Sets the default email of the contact to \a str. 123 Sets the default email of the contact to \a str.
128*/ 124*/
129 125
130/*! \fn void OPimContact::setHomeStreet( const QString &str ) 126/*! \fn void OPimContact::setHomeStreet( const QString &str )
131 Sets the home street address of the contact to \a str. 127 Sets the home street address of the contact to \a str.
132*/ 128*/
133 129
134/*! \fn void OPimContact::setHomeCity( const QString &str ) 130/*! \fn void OPimContact::setHomeCity( const QString &str )
135 Sets the home city of the contact to \a str. 131 Sets the home city of the contact to \a str.
136*/ 132*/
137 133
138/*! \fn void OPimContact::setHomeState( const QString &str ) 134/*! \fn void OPimContact::setHomeState( const QString &str )
139 Sets the home state of the contact to \a str. 135 Sets the home state of the contact to \a str.
140*/ 136*/
141 137
142/*! \fn void OPimContact::setHomeZip( const QString &str ) 138/*! \fn void OPimContact::setHomeZip( const QString &str )
diff --git a/libopie2/opiepim/core/opimcontactfields.cpp b/libopie2/opiepim/core/opimcontactfields.cpp
index 4b0ba3b..120beb6 100644
--- a/libopie2/opiepim/core/opimcontactfields.cpp
+++ b/libopie2/opiepim/core/opimcontactfields.cpp
@@ -1,135 +1,133 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de> 3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 "opimcontactfields.h" 30#include "opimcontactfields.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <opie2/opimcontact.h> 33#include <opie2/opimcontact.h>
34#include <qpe/recordfields.h> // We should use our own enum in the future ..
35#include <qpe/config.h> 34#include <qpe/config.h>
36 35
37/* QT */ 36/* QT */
38#include <qobject.h> 37#include <qobject.h>
39#include <qstringlist.h>
40 38
41 39
42namespace Opie 40namespace Opie
43{ 41{
44/*! 42/*!
45 \internal 43 \internal
46 Returns a list of personal field names for a contact. 44 Returns a list of personal field names for a contact.
47*/ 45*/
48QStringList OPimContactFields::personalfields( bool sorted, bool translated ) 46QStringList OPimContactFields::personalfields( bool sorted, bool translated )
49{ 47{
50 QStringList list; 48 QStringList list;
51 QMap<int, QString> mapIdToStr; 49 QMap<int, QString> mapIdToStr;
52 if ( translated ) 50 if ( translated )
53 mapIdToStr = idToTrFields(); 51 mapIdToStr = idToTrFields();
54 else 52 else
55 mapIdToStr = idToUntrFields(); 53 mapIdToStr = idToUntrFields();
56 54
57 list.append( mapIdToStr[ Qtopia::AddressUid ] ); 55 list.append( mapIdToStr[ Qtopia::AddressUid ] );
58 list.append( mapIdToStr[ Qtopia::AddressCategory ] ); 56 list.append( mapIdToStr[ Qtopia::AddressCategory ] );
59 57
60 list.append( mapIdToStr[ Qtopia::Title ] ); 58 list.append( mapIdToStr[ Qtopia::Title ] );
61 list.append( mapIdToStr[ Qtopia::FirstName ] ); 59 list.append( mapIdToStr[ Qtopia::FirstName ] );
62 list.append( mapIdToStr[ Qtopia::MiddleName ] ); 60 list.append( mapIdToStr[ Qtopia::MiddleName ] );
63 list.append( mapIdToStr[ Qtopia::LastName ] ); 61 list.append( mapIdToStr[ Qtopia::LastName ] );
64 list.append( mapIdToStr[ Qtopia::Suffix ] ); 62 list.append( mapIdToStr[ Qtopia::Suffix ] );
65 list.append( mapIdToStr[ Qtopia::FileAs ] ); 63 list.append( mapIdToStr[ Qtopia::FileAs ] );
66 64
67 list.append( mapIdToStr[ Qtopia::JobTitle ] ); 65 list.append( mapIdToStr[ Qtopia::JobTitle ] );
68 list.append( mapIdToStr[ Qtopia::Department ] ); 66 list.append( mapIdToStr[ Qtopia::Department ] );
69 list.append( mapIdToStr[ Qtopia::Company ] ); 67 list.append( mapIdToStr[ Qtopia::Company ] );
70 68
71 list.append( mapIdToStr[ Qtopia::Notes ] ); 69 list.append( mapIdToStr[ Qtopia::Notes ] );
72 list.append( mapIdToStr[ Qtopia::Groups ] ); 70 list.append( mapIdToStr[ Qtopia::Groups ] );
73 71
74 if ( sorted ) list.sort(); 72 if ( sorted ) list.sort();
75 return list; 73 return list;
76} 74}
77 75
78/*! 76/*!
79 \internal 77 \internal
80 Returns a list of details field names for a contact. 78 Returns a list of details field names for a contact.
81*/ 79*/
82QStringList OPimContactFields::detailsfields( bool sorted, bool translated ) 80QStringList OPimContactFields::detailsfields( bool sorted, bool translated )
83{ 81{
84 QStringList list; 82 QStringList list;
85 QMap<int, QString> mapIdToStr; 83 QMap<int, QString> mapIdToStr;
86 if ( translated ) 84 if ( translated )
87 mapIdToStr = idToTrFields(); 85 mapIdToStr = idToTrFields();
88 else 86 else
89 mapIdToStr = idToUntrFields(); 87 mapIdToStr = idToUntrFields();
90 88
91 list.append( mapIdToStr[ Qtopia::Office ] ); 89 list.append( mapIdToStr[ Qtopia::Office ] );
92 list.append( mapIdToStr[ Qtopia::Profession ] ); 90 list.append( mapIdToStr[ Qtopia::Profession ] );
93 list.append( mapIdToStr[ Qtopia::Assistant ] ); 91 list.append( mapIdToStr[ Qtopia::Assistant ] );
94 list.append( mapIdToStr[ Qtopia::Manager ] ); 92 list.append( mapIdToStr[ Qtopia::Manager ] );
95 93
96 list.append( mapIdToStr[ Qtopia::Spouse ] ); 94 list.append( mapIdToStr[ Qtopia::Spouse ] );
97 list.append( mapIdToStr[ Qtopia::Gender ] ); 95 list.append( mapIdToStr[ Qtopia::Gender ] );
98 list.append( mapIdToStr[ Qtopia::Birthday ] ); 96 list.append( mapIdToStr[ Qtopia::Birthday ] );
99 list.append( mapIdToStr[ Qtopia::Anniversary ] ); 97 list.append( mapIdToStr[ Qtopia::Anniversary ] );
100 list.append( mapIdToStr[ Qtopia::Nickname ] ); 98 list.append( mapIdToStr[ Qtopia::Nickname ] );
101 list.append( mapIdToStr[ Qtopia::Children ] ); 99 list.append( mapIdToStr[ Qtopia::Children ] );
102 100
103 if ( sorted ) list.sort(); 101 if ( sorted ) list.sort();
104 return list; 102 return list;
105} 103}
106 104
107/*! 105/*!
108 \internal 106 \internal
109 Returns a list of phone field names for a contact. 107 Returns a list of phone field names for a contact.
110*/ 108*/
111QStringList OPimContactFields::phonefields( bool sorted, bool translated ) 109QStringList OPimContactFields::phonefields( bool sorted, bool translated )
112{ 110{
113 QStringList list; 111 QStringList list;
114 QMap<int, QString> mapIdToStr; 112 QMap<int, QString> mapIdToStr;
115 if ( translated ) 113 if ( translated )
116 mapIdToStr = idToTrFields(); 114 mapIdToStr = idToTrFields();
117 else 115 else
118 mapIdToStr = idToUntrFields(); 116 mapIdToStr = idToUntrFields();
119 117
120 list.append( mapIdToStr[ Qtopia::BusinessPhone ] ); 118 list.append( mapIdToStr[ Qtopia::BusinessPhone ] );
121 list.append( mapIdToStr[ Qtopia::BusinessFax ] ); 119 list.append( mapIdToStr[ Qtopia::BusinessFax ] );
122 list.append( mapIdToStr[ Qtopia::BusinessMobile ] ); 120 list.append( mapIdToStr[ Qtopia::BusinessMobile ] );
123 list.append( mapIdToStr[ Qtopia::BusinessPager ] ); 121 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
124 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] ); 122 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
125 123
126 list.append( mapIdToStr[ Qtopia::DefaultEmail ] ); 124 list.append( mapIdToStr[ Qtopia::DefaultEmail ] );
127 list.append( mapIdToStr[ Qtopia::Emails ] ); 125 list.append( mapIdToStr[ Qtopia::Emails ] );
128 126
129 list.append( mapIdToStr[ Qtopia::HomePhone ] ); 127 list.append( mapIdToStr[ Qtopia::HomePhone ] );
130 list.append( mapIdToStr[ Qtopia::HomeFax ] ); 128 list.append( mapIdToStr[ Qtopia::HomeFax ] );
131 list.append( mapIdToStr[ Qtopia::HomeMobile ] ); 129 list.append( mapIdToStr[ Qtopia::HomeMobile ] );
132 // list.append( mapIdToStr[Qtopia::HomePager] ); 130 // list.append( mapIdToStr[Qtopia::HomePager] );
133 list.append( mapIdToStr[ Qtopia::HomeWebPage ] ); 131 list.append( mapIdToStr[ Qtopia::HomeWebPage ] );
134 132
135 if ( sorted ) list.sort(); 133 if ( sorted ) list.sort();
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp
index 3ddbf85..77730e9 100644
--- a/libopie2/opiepim/core/opimevent.cpp
+++ b/libopie2/opiepim/core/opimevent.cpp
@@ -1,138 +1,135 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de> 3 Copyright (C) Stefan Eilers <Eilers.Stefan@epost.de>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 "opimevent.h" 30#include "opimevent.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <opie2/opimrecurrence.h> 33#include <opie2/opimrecurrence.h>
34#include <opie2/opimresolver.h> 34#include <opie2/opimresolver.h>
35#include <opie2/opimnotifymanager.h> 35#include <opie2/opimnotifymanager.h>
36#include <qpe/categories.h> 36#include <qpe/categories.h>
37#include <qpe/palmtopuidgen.h>
38#include <qpe/stringutil.h> 37#include <qpe/stringutil.h>
39 38
40/* QT */ 39/* QT */
41#include <qshared.h>
42#include <qarray.h>
43 40
44namespace Opie 41namespace Opie
45{ 42{
46 43
47int OCalendarHelper::week( const QDate& date ) 44int OCalendarHelper::week( const QDate& date )
48{ 45{
49 // Calculates the week this date is in within that 46 // Calculates the week this date is in within that
50 // month. Equals the "row" is is in in the month view 47 // month. Equals the "row" is is in in the month view
51 int week = 1; 48 int week = 1;
52 QDate tmp( date.year(), date.month(), 1 ); 49 QDate tmp( date.year(), date.month(), 1 );
53 if ( date.dayOfWeek() < tmp.dayOfWeek() ) 50 if ( date.dayOfWeek() < tmp.dayOfWeek() )
54 ++week; 51 ++week;
55 52
56 week += ( date.day() - 1 ) / 7; 53 week += ( date.day() - 1 ) / 7;
57 54
58 return week; 55 return week;
59} 56}
60 57
61 58
62int OCalendarHelper::ocurrence( const QDate& date ) 59int OCalendarHelper::ocurrence( const QDate& date )
63{ 60{
64 // calculates the number of occurrances of this day of the 61 // calculates the number of occurrances of this day of the
65 // week till the given date (e.g 3rd Wednesday of the month) 62 // week till the given date (e.g 3rd Wednesday of the month)
66 return ( date.day() - 1 ) / 7 + 1; 63 return ( date.day() - 1 ) / 7 + 1;
67} 64}
68 65
69 66
70int OCalendarHelper::dayOfWeek( char day ) 67int OCalendarHelper::dayOfWeek( char day )
71{ 68{
72 int dayOfWeek = 1; 69 int dayOfWeek = 1;
73 char i = OPimRecurrence::MON; 70 char i = OPimRecurrence::MON;
74 while ( !( i & day ) && i <= OPimRecurrence::SUN ) 71 while ( !( i & day ) && i <= OPimRecurrence::SUN )
75 { 72 {
76 i <<= 1; 73 i <<= 1;
77 ++dayOfWeek; 74 ++dayOfWeek;
78 } 75 }
79 return dayOfWeek; 76 return dayOfWeek;
80} 77}
81 78
82 79
83int OCalendarHelper::monthDiff( const QDate& first, const QDate& second ) 80int OCalendarHelper::monthDiff( const QDate& first, const QDate& second )
84{ 81{
85 return ( second.year() - first.year() ) * 12 + 82 return ( second.year() - first.year() ) * 12 +
86 second.month() - first.month(); 83 second.month() - first.month();
87} 84}
88 85
89 86
90struct OPimEvent::Data : public QShared 87struct OPimEvent::Data : public QShared
91{ 88{
92 Data() : QShared() 89 Data() : QShared()
93 { 90 {
94 child = 0; 91 child = 0;
95 recur = 0; 92 recur = 0;
96 manager = 0; 93 manager = 0;
97 isAllDay = false; 94 isAllDay = false;
98 parent = 0; 95 parent = 0;
99 } 96 }
100 ~Data() 97 ~Data()
101 { 98 {
102 delete manager; 99 delete manager;
103 delete recur; 100 delete recur;
104 } 101 }
105 QString description; 102 QString description;
106 QString location; 103 QString location;
107 OPimNotifyManager* manager; 104 OPimNotifyManager* manager;
108 OPimRecurrence* recur; 105 OPimRecurrence* recur;
109 QString note; 106 QString note;
110 QDateTime created; 107 QDateTime created;
111 QDateTime start; 108 QDateTime start;
112 QDateTime end; 109 QDateTime end;
113bool isAllDay : 1; 110bool isAllDay : 1;
114 QString timezone; 111 QString timezone;
115 QArray<int>* child; 112 QArray<int>* child;
116 int parent; 113 int parent;
117}; 114};
118 115
119 116
120OPimEvent::OPimEvent( int uid ) 117OPimEvent::OPimEvent( int uid )
121 : OPimRecord( uid ) 118 : OPimRecord( uid )
122{ 119{
123 data = new Data; 120 data = new Data;
124} 121}
125 122
126 123
127OPimEvent::OPimEvent( const OPimEvent& ev ) 124OPimEvent::OPimEvent( const OPimEvent& ev )
128 : OPimRecord( ev ), data( ev.data ) 125 : OPimRecord( ev ), data( ev.data )
129{ 126{
130 data->ref(); 127 data->ref();
131} 128}
132 129
133 130
134OPimEvent::OPimEvent( const QMap<int, QString> map ) 131OPimEvent::OPimEvent( const QMap<int, QString> map )
135 : OPimRecord( 0 ) 132 : OPimRecord( 0 )
136{ 133{
137 data = new Data; 134 data = new Data;
138 135
diff --git a/libopie2/opiepim/core/opimnotify.cpp b/libopie2/opiepim/core/opimnotify.cpp
index 43858f0..417b0b9 100644
--- a/libopie2/opiepim/core/opimnotify.cpp
+++ b/libopie2/opiepim/core/opimnotify.cpp
@@ -1,129 +1,128 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org> 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 "opimnotify.h" 30#include "opimnotify.h"
31 31
32/* QT */ 32/* QT */
33#include <qshared.h>
34 33
35namespace Opie 34namespace Opie
36{ 35{
37 36
38struct OPimNotify::Data : public QShared 37struct OPimNotify::Data : public QShared
39{ 38{
40 Data() : QShared(), dur( -1 ), parent( 0 ) 39 Data() : QShared(), dur( -1 ), parent( 0 )
41 { 40 {
42 } 41 }
43 QDateTime start; 42 QDateTime start;
44 int dur; 43 int dur;
45 QString application; 44 QString application;
46 int parent; 45 int parent;
47}; 46};
48 47
49OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent ) 48OPimNotify::OPimNotify( const QDateTime& start, int duration, int parent )
50{ 49{
51 data = new Data; 50 data = new Data;
52 data->start = start; 51 data->start = start;
53 data->dur = duration; 52 data->dur = duration;
54 data->parent = parent; 53 data->parent = parent;
55} 54}
56 55
57 56
58OPimNotify::OPimNotify( const OPimNotify& noti ) 57OPimNotify::OPimNotify( const OPimNotify& noti )
59 : data( noti.data ) 58 : data( noti.data )
60{ 59{
61 data->ref(); 60 data->ref();
62} 61}
63 62
64 63
65OPimNotify::~OPimNotify() 64OPimNotify::~OPimNotify()
66{ 65{
67 if ( data->deref() ) 66 if ( data->deref() )
68 { 67 {
69 delete data; 68 delete data;
70 data = 0l; 69 data = 0l;
71 } 70 }
72} 71}
73 72
74 73
75OPimNotify &OPimNotify::operator=( const OPimNotify& noti ) 74OPimNotify &OPimNotify::operator=( const OPimNotify& noti )
76{ 75{
77 noti.data->ref(); 76 noti.data->ref();
78 deref(); 77 deref();
79 data = noti.data; 78 data = noti.data;
80 79
81 return *this; 80 return *this;
82} 81}
83 82
84 83
85bool OPimNotify::operator==( const OPimNotify& noti ) 84bool OPimNotify::operator==( const OPimNotify& noti )
86{ 85{
87 if ( data == noti.data ) return true; 86 if ( data == noti.data ) return true;
88 if ( data->dur != noti.data->dur ) return false; 87 if ( data->dur != noti.data->dur ) return false;
89 if ( data->parent != noti.data->parent ) return false; 88 if ( data->parent != noti.data->parent ) return false;
90 if ( data->application != noti.data->application ) return false; 89 if ( data->application != noti.data->application ) return false;
91 if ( data->start != noti.data->start ) return false; 90 if ( data->start != noti.data->start ) return false;
92 91
93 return true; 92 return true;
94} 93}
95 94
96 95
97QDateTime OPimNotify::dateTime() const 96QDateTime OPimNotify::dateTime() const
98{ 97{
99 return data->start; 98 return data->start;
100} 99}
101 100
102 101
103QString OPimNotify::service() const 102QString OPimNotify::service() const
104{ 103{
105 return data->application; 104 return data->application;
106} 105}
107 106
108 107
109int OPimNotify::parent() const 108int OPimNotify::parent() const
110{ 109{
111 return data->parent; 110 return data->parent;
112} 111}
113 112
114 113
115int OPimNotify::duration() const 114int OPimNotify::duration() const
116{ 115{
117 return data->dur; 116 return data->dur;
118} 117}
119 118
120 119
121QDateTime OPimNotify::endTime() const 120QDateTime OPimNotify::endTime() const
122{ 121{
123 return QDateTime( data->start.date(), data->start.time().addSecs( data->dur ) ); 122 return QDateTime( data->start.date(), data->start.time().addSecs( data->dur ) );
124} 123}
125 124
126 125
127void OPimNotify::setDateTime( const QDateTime& time ) 126void OPimNotify::setDateTime( const QDateTime& time )
128{ 127{
129 copyIntern(); 128 copyIntern();
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp
index c603f44..67eed41 100644
--- a/libopie2/opiepim/core/opimrecord.cpp
+++ b/libopie2/opiepim/core/opimrecord.cpp
@@ -1,133 +1,132 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org> 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 "opimrecord.h" 30#include "opimrecord.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <qpe/categories.h> 33#include <qpe/categories.h>
34#include <qpe/categoryselect.h> 34#include <qpe/categoryselect.h>
35 35
36/* QT */ 36/* QT */
37#include <qarray.h>
38 37
39namespace Opie 38namespace Opie
40{ 39{
41Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia ); 40Qtopia::UidGen OPimRecord::m_uidGen( Qtopia::UidGen::Qtopia );
42 41
43 42
44OPimRecord::OPimRecord( int uid ) 43OPimRecord::OPimRecord( int uid )
45 : Qtopia::Record() 44 : Qtopia::Record()
46{ 45{
47 46
48 m_lastHit = -1; 47 m_lastHit = -1;
49 setUid( uid ); 48 setUid( uid );
50} 49}
51 50
52 51
53OPimRecord::~OPimRecord() 52OPimRecord::~OPimRecord()
54{} 53{}
55 54
56 55
57OPimRecord::OPimRecord( const OPimRecord& rec ) 56OPimRecord::OPimRecord( const OPimRecord& rec )
58 : Qtopia::Record( rec ) 57 : Qtopia::Record( rec )
59{ 58{
60 ( *this ) = rec; 59 ( *this ) = rec;
61} 60}
62 61
63 62
64OPimRecord &OPimRecord::operator=( const OPimRecord& rec ) 63OPimRecord &OPimRecord::operator=( const OPimRecord& rec )
65{ 64{
66 if ( this == &rec ) return * this; 65 if ( this == &rec ) return * this;
67 66
68 Qtopia::Record::operator=( rec ); 67 Qtopia::Record::operator=( rec );
69 m_xrefman = rec.m_xrefman; 68 m_xrefman = rec.m_xrefman;
70 m_lastHit = rec.m_lastHit; 69 m_lastHit = rec.m_lastHit;
71 70
72 return *this; 71 return *this;
73} 72}
74 73
75 74
76/* 75/*
77 * category names 76 * category names
78 */ 77 */
79QStringList OPimRecord::categoryNames( const QString& appname ) const 78QStringList OPimRecord::categoryNames( const QString& appname ) const
80{ 79{
81 QStringList list; 80 QStringList list;
82 QArray<int> cats = categories(); 81 QArray<int> cats = categories();
83 Categories catDB; 82 Categories catDB;
84 catDB.load( categoryFileName() ); 83 catDB.load( categoryFileName() );
85 84
86 for ( uint i = 0; i < cats.count(); i++ ) 85 for ( uint i = 0; i < cats.count(); i++ )
87 { 86 {
88 list << catDB.label( appname, cats[ i ] ); 87 list << catDB.label( appname, cats[ i ] );
89 } 88 }
90 89
91 return list; 90 return list;
92} 91}
93 92
94 93
95void OPimRecord::setCategoryNames( const QStringList& ) 94void OPimRecord::setCategoryNames( const QStringList& )
96{ 95{
97} 96}
98 97
99 98
100void OPimRecord::addCategoryName( const QString& ) 99void OPimRecord::addCategoryName( const QString& )
101{ 100{
102 Categories catDB; 101 Categories catDB;
103 catDB.load( categoryFileName() ); 102 catDB.load( categoryFileName() );
104 103
105 104
106} 105}
107 106
108 107
109bool OPimRecord::isEmpty() const 108bool OPimRecord::isEmpty() const
110{ 109{
111 return ( uid() == 0 ); 110 return ( uid() == 0 );
112} 111}
113 112
114 113
115/*QString OPimRecord::crossToString()const { 114/*QString OPimRecord::crossToString()const {
116 QString str; 115 QString str;
117 QMap<QString, QArray<int> >::ConstIterator it; 116 QMap<QString, QArray<int> >::ConstIterator it;
118 for (it = m_relations.begin(); it != m_relations.end(); ++it ) { 117 for (it = m_relations.begin(); it != m_relations.end(); ++it ) {
119 QArray<int> id = it.data(); 118 QArray<int> id = it.data();
120 for ( uint i = 0; i < id.size(); ++i ) { 119 for ( uint i = 0; i < id.size(); ++i ) {
121 str += it.key() + "," + QString::number( i ) + ";"; 120 str += it.key() + "," + QString::number( i ) + ";";
122 } 121 }
123 } 122 }
124 str = str.remove( str.length()-1, 1); // strip the ; 123 str = str.remove( str.length()-1, 1); // strip the ;
125 //qWarning("IDS " + str ); 124 //qWarning("IDS " + str );
126 125
127 return str; 126 return str;
128 }*/ 127 }*/
129/* if uid = 1 assign a new one */ 128/* if uid = 1 assign a new one */
130void OPimRecord::setUid( int uid ) 129void OPimRecord::setUid( int uid )
131{ 130{
132 if ( uid == 1 ) 131 if ( uid == 1 )
133 uid = uidGen().generate(); 132 uid = uidGen().generate();
diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp
index 34df807..f246bfd 100644
--- a/libopie2/opiepim/core/opimtodo.cpp
+++ b/libopie2/opiepim/core/opimtodo.cpp
@@ -1,139 +1,138 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) The Main Author <main-author@whereever.org> 3 Copyright (C) The Main Author <main-author@whereever.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6 .>+-= 6 .>+-=
7 _;:, .> :=|. This program is free software; you can 7 _;:, .> :=|. This program is free software; you can
8.> <`_, > . <= redistribute it and/or modify it under 8.> <`_, > . <= redistribute it and/or modify it under
9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 9:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
10.="- .-=="i, .._ License as published by the Free Software 10.="- .-=="i, .._ License as published by the Free Software
11 - . .-<_> .<> Foundation; either version 2 of the License, 11 - . .-<_> .<> Foundation; either version 2 of the License,
12 ._= =} : or (at your option) any later version. 12 ._= =} : or (at your option) any later version.
13 .%`+i> _;_. 13 .%`+i> _;_.
14 .i_,=:_. -<s. This program is distributed in the hope that 14 .i_,=:_. -<s. This program is distributed in the hope that
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 "opimtodo.h" 30#include "opimtodo.h"
31 31
32/* OPIE */ 32/* OPIE */
33#include <opie2/opimstate.h> 33#include <opie2/opimstate.h>
34#include <opie2/opimrecurrence.h> 34#include <opie2/opimrecurrence.h>
35#include <opie2/opimmaintainer.h> 35#include <opie2/opimmaintainer.h>
36#include <opie2/opimnotifymanager.h> 36#include <opie2/opimnotifymanager.h>
37#include <opie2/opimresolver.h> 37#include <opie2/opimresolver.h>
38#include <qpe/palmtopuidgen.h> 38#include <qpe/palmtopuidgen.h>
39#include <qpe/stringutil.h>
40#include <qpe/palmtoprecord.h> 39#include <qpe/palmtoprecord.h>
41#include <qpe/stringutil.h>
42#include <qpe/categories.h> 40#include <qpe/categories.h>
43#include <qpe/categoryselect.h> 41#include <qpe/categoryselect.h>
42#include <qpe/stringutil.h>
44 43
45/* QT */ 44/* QT */
46#include <qobject.h> 45#include <qobject.h>
47#include <qshared.h> 46#include <qshared.h>
48 47
49namespace Opie 48namespace Opie
50{ 49{
51 50
52struct OPimTodo::OPimTodoData : public QShared 51struct OPimTodo::OPimTodoData : public QShared
53{ 52{
54 OPimTodoData() : QShared() 53 OPimTodoData() : QShared()
55 { 54 {
56 recur = 0; 55 recur = 0;
57 state = 0; 56 state = 0;
58 maintainer = 0; 57 maintainer = 0;
59 notifiers = 0; 58 notifiers = 0;
60 }; 59 };
61 ~OPimTodoData() 60 ~OPimTodoData()
62 { 61 {
63 delete recur; 62 delete recur;
64 delete maintainer; 63 delete maintainer;
65 delete notifiers; 64 delete notifiers;
66 } 65 }
67 66
68 QDate date; 67 QDate date;
69 bool isCompleted: 1; 68 bool isCompleted: 1;
70 bool hasDate: 1; 69 bool hasDate: 1;
71 int priority; 70 int priority;
72 QString desc; 71 QString desc;
73 QString sum; 72 QString sum;
74 QMap<QString, QString> extra; 73 QMap<QString, QString> extra;
75 ushort prog; 74 ushort prog;
76 OPimState *state; 75 OPimState *state;
77 OPimRecurrence *recur; 76 OPimRecurrence *recur;
78 OPimMaintainer *maintainer; 77 OPimMaintainer *maintainer;
79 QDate start; 78 QDate start;
80 QDate completed; 79 QDate completed;
81 OPimNotifyManager *notifiers; 80 OPimNotifyManager *notifiers;
82}; 81};
83 82
84 83
85OPimTodo::OPimTodo( const OPimTodo &event ) 84OPimTodo::OPimTodo( const OPimTodo &event )
86 : OPimRecord( event ), data( event.data ) 85 : OPimRecord( event ), data( event.data )
87{ 86{
88 data->ref(); 87 data->ref();
89 // qWarning("ref up"); 88 // qWarning("ref up");
90} 89}
91 90
92 91
93OPimTodo::~OPimTodo() 92OPimTodo::~OPimTodo()
94{ 93{
95 94
96 // qWarning("~OPimTodo " ); 95 // qWarning("~OPimTodo " );
97 if ( data->deref() ) 96 if ( data->deref() )
98 { 97 {
99 // qWarning("OPimTodo::dereffing"); 98 // qWarning("OPimTodo::dereffing");
100 delete data; 99 delete data;
101 data = 0l; 100 data = 0l;
102 } 101 }
103} 102}
104 103
105 104
106OPimTodo::OPimTodo( bool completed, int priority, 105OPimTodo::OPimTodo( bool completed, int priority,
107 const QArray<int> &category, 106 const QArray<int> &category,
108 const QString& summary, 107 const QString& summary,
109 const QString &description, 108 const QString &description,
110 ushort progress, 109 ushort progress,
111 bool hasDate, QDate date, int uid ) 110 bool hasDate, QDate date, int uid )
112 : OPimRecord( uid ) 111 : OPimRecord( uid )
113{ 112{
114 // qWarning("OPimTodoData " + summary); 113 // qWarning("OPimTodoData " + summary);
115 setCategories( category ); 114 setCategories( category );
116 115
117 data = new OPimTodoData; 116 data = new OPimTodoData;
118 117
119 data->date = date; 118 data->date = date;
120 data->isCompleted = completed; 119 data->isCompleted = completed;
121 data->hasDate = hasDate; 120 data->hasDate = hasDate;
122 data->priority = priority; 121 data->priority = priority;
123 data->sum = summary; 122 data->sum = summary;
124 data->prog = progress; 123 data->prog = progress;
125 data->desc = Qtopia::simplifyMultiLineSpace( description ); 124 data->desc = Qtopia::simplifyMultiLineSpace( description );
126} 125}
127 126
128 127
129OPimTodo::OPimTodo( bool completed, int priority, 128OPimTodo::OPimTodo( bool completed, int priority,
130 const QStringList &category, 129 const QStringList &category,
131 const QString& summary, 130 const QString& summary,
132 const QString &description, 131 const QString &description,
133 ushort progress, 132 ushort progress,
134 bool hasDate, QDate date, int uid ) 133 bool hasDate, QDate date, int uid )
135 : OPimRecord( uid ) 134 : OPimRecord( uid )
136{ 135{
137 // qWarning("OPimTodoData" + summary); 136 // qWarning("OPimTodoData" + summary);
138 setCategories( idsFromString( category.join( ";" ) ) ); 137 setCategories( idsFromString( category.join( ";" ) ) );
139 138
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp
index 49628c9..49ddeb6 100644
--- a/libopie2/opieui/ofontselector.cpp
+++ b/libopie2/opieui/ofontselector.cpp
@@ -1,135 +1,134 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Robert Griebl <sandman@handhelds.org> 3 Copyright (C) Robert Griebl <sandman@handhelds.org>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
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/* OPIE */ 30/* OPIE */
31#include <opie2/ofontselector.h> 31#include <opie2/ofontselector.h>
32#include <qpe/fontdatabase.h> 32#include <qpe/fontdatabase.h>
33 33
34/* QT */ 34/* QT */
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qlistbox.h> 36#include <qlistbox.h>
37#include <qcombobox.h> 37#include <qcombobox.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qfont.h>
40#include <qmultilineedit.h> 39#include <qmultilineedit.h>
41 40
42using namespace Opie; 41using namespace Opie;
43 42
44namespace Opie 43namespace Opie
45{ 44{
46 45
47class OFontSelectorPrivate 46class OFontSelectorPrivate
48{ 47{
49public: 48public:
50 QListBox * m_font_family_list; 49 QListBox * m_font_family_list;
51 QComboBox * m_font_style_list; 50 QComboBox * m_font_style_list;
52 QComboBox * m_font_size_list; 51 QComboBox * m_font_size_list;
53 QMultiLineEdit *m_preview; 52 QMultiLineEdit *m_preview;
54 53
55 bool m_pointbug : 1; 54 bool m_pointbug : 1;
56 55
57 FontDatabase m_fdb; 56 FontDatabase m_fdb;
58}; 57};
59 58
60}; 59};
61 60
62namespace 61namespace
63{ 62{
64 63
65class FontListItem : public QListBoxText 64class FontListItem : public QListBoxText
66{ 65{
67public: 66public:
68 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() 67 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText()
69 { 68 {
70 m_name = t; 69 m_name = t;
71 m_styles = styles; 70 m_styles = styles;
72 m_sizes = sizes; 71 m_sizes = sizes;
73 72
74 QString str = t; 73 QString str = t;
75 str [0] = str [0]. upper(); 74 str [0] = str [0]. upper();
76 setText ( str ); 75 setText ( str );
77 } 76 }
78 77
79 QString family() const 78 QString family() const
80 { 79 {
81 return m_name; 80 return m_name;
82 } 81 }
83 82
84 const QStringList &styles() const 83 const QStringList &styles() const
85 { 84 {
86 return m_styles; 85 return m_styles;
87 } 86 }
88 87
89 const QValueList<int> &sizes() const 88 const QValueList<int> &sizes() const
90 { 89 {
91 return m_sizes; 90 return m_sizes;
92 } 91 }
93 92
94private: 93private:
95 QStringList m_styles; 94 QStringList m_styles;
96 QValueList<int> m_sizes; 95 QValueList<int> m_sizes;
97 QString m_name; 96 QString m_name;
98}; 97};
99 98
100 99
101static int findItemCB( QComboBox *box, const QString &str ) 100static int findItemCB( QComboBox *box, const QString &str )
102{ 101{
103 for ( int i = 0; i < box->count(); i++ ) 102 for ( int i = 0; i < box->count(); i++ )
104 { 103 {
105 if ( box->text ( i ) == str ) 104 if ( box->text ( i ) == str )
106 return i; 105 return i;
107 } 106 }
108 return -1; 107 return -1;
109} 108}
110 109
111} 110}
112/* static same as anon. namespace */ 111/* static same as anon. namespace */
113static int qt_version() 112static int qt_version()
114{ 113{
115 const char *qver = qVersion(); 114 const char *qver = qVersion();
116 115
117 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); 116 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
118} 117}
119 118
120/** 119/**
121 * Constructs the Selector object 120 * Constructs the Selector object
122 * @param withpreview If a font preview should be given 121 * @param withpreview If a font preview should be given
123 * @param parent The parent of the Font Selector 122 * @param parent The parent of the Font Selector
124 * @param name The name of the object 123 * @param name The name of the object
125 * @param fl WidgetFlags 124 * @param fl WidgetFlags
126 */ 125 */
127OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) 126OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl )
128{ 127{
129 d = new OFontSelectorPrivate(); 128 d = new OFontSelectorPrivate();
130 129
131 QGridLayout *gridLayout = new QGridLayout( this, 0, 0, 4, 4 ); 130 QGridLayout *gridLayout = new QGridLayout( this, 0, 0, 4, 4 );
132 gridLayout->setRowStretch( 4, 10 ); 131 gridLayout->setRowStretch( 4, 10 );
133 132
134 d->m_font_family_list = new QListBox( this, "FontListBox" ); 133 d->m_font_family_list = new QListBox( this, "FontListBox" );
135 gridLayout->addMultiCellWidget( d->m_font_family_list, 0, 4, 0, 0 ); 134 gridLayout->addMultiCellWidget( d->m_font_family_list, 0, 4, 0, 0 );
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp
index 38f3fe2..84617f8 100644
--- a/libopie2/opieui/olistview.cpp
+++ b/libopie2/opieui/olistview.cpp
@@ -1,130 +1,127 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 =. (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de> 3 =. (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 .=l. 4 .=l.
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This program is free software; you can 6 _;:,     .>    :=|. This program is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This program is distributed in the hope that 13    .i_,=:_.      -<s. This program is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
18..}^=.=       =       ; Library General Public License for more 18..}^=.=       =       ; Library General Public License for more
19++=   -.     .`     .: details. 19++=   -.     .`     .: details.
20 :     =  ...= . :.=- 20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30/* QT */ 30/* QT */
31 31
32#include <qcolor.h>
33#include <qheader.h>
34#include <qpainter.h>
35#include <qpixmap.h> 32#include <qpixmap.h>
36 33
37/* OPIE */ 34/* OPIE */
38 35
39#include <opie2/odebug.h> 36#include <opie2/odebug.h>
40#include <opie2/olistview.h> 37#include <opie2/olistview.h>
41 38
42/*====================================================================================== 39/*======================================================================================
43 * OListView 40 * OListView
44 *======================================================================================*/ 41 *======================================================================================*/
45 42
46OListView::OListView( QWidget *parent, const char *name ) 43OListView::OListView( QWidget *parent, const char *name )
47 :QListView( parent, name ) 44 :QListView( parent, name )
48{ 45{
49 //FIXME: get from global settings and calculate ==> see oglobalsettings.* 46 //FIXME: get from global settings and calculate ==> see oglobalsettings.*
50 47
51 m_alternateBackground = QColor( 238, 246, 255 ); 48 m_alternateBackground = QColor( 238, 246, 255 );
52 m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); 49 m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine );
53 m_fullWidth = true; 50 m_fullWidth = true;
54 connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); 51 connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*)));
55} 52}
56 53
57OListView::~OListView() 54OListView::~OListView()
58{ 55{
59} 56}
60 57
61void OListView::setFullWidth( bool fullWidth ) 58void OListView::setFullWidth( bool fullWidth )
62{ 59{
63 m_fullWidth = m_fullWidth; 60 m_fullWidth = m_fullWidth;
64 #if QT_VERSION > 290 61 #if QT_VERSION > 290
65 header()->setStretchEnabled( fullWidth, columns()-1 ); 62 header()->setStretchEnabled( fullWidth, columns()-1 );
66 #endif 63 #endif
67} 64}
68 65
69bool OListView::fullWidth() const 66bool OListView::fullWidth() const
70{ 67{
71 return m_fullWidth; 68 return m_fullWidth;
72} 69}
73 70
74int OListView::addColumn( const QString& label, int width ) 71int OListView::addColumn( const QString& label, int width )
75{ 72{
76 int result = QListView::addColumn( label, width ); 73 int result = QListView::addColumn( label, width );
77 #if QT_VERSION > 290 74 #if QT_VERSION > 290
78 if (m_fullWidth) { 75 if (m_fullWidth) {
79 header()->setStretchEnabled( false, columns()-2 ); 76 header()->setStretchEnabled( false, columns()-2 );
80 header()->setStretchEnabled( true, columns()-1 ); 77 header()->setStretchEnabled( true, columns()-1 );
81 } 78 }
82 #endif 79 #endif
83 return result; 80 return result;
84} 81}
85 82
86int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) 83int OListView::addColumn( const QIconSet& iconset, const QString& label, int width )
87{ 84{
88 int result = QListView::addColumn( iconset, label, width ); 85 int result = QListView::addColumn( iconset, label, width );
89 #if QT_VERSION > 290 86 #if QT_VERSION > 290
90 if (m_fullWidth) { 87 if (m_fullWidth) {
91 header()->setStretchEnabled( false, columns()-2 ); 88 header()->setStretchEnabled( false, columns()-2 );
92 header()->setStretchEnabled( true, columns()-1 ); 89 header()->setStretchEnabled( true, columns()-1 );
93 } 90 }
94 #endif 91 #endif
95 return result; 92 return result;
96} 93}
97 94
98void OListView::removeColumn( int index ) 95void OListView::removeColumn( int index )
99{ 96{
100 QListView::removeColumn(index); 97 QListView::removeColumn(index);
101 #if QT_VERSION > 290 98 #if QT_VERSION > 290
102 if ( m_fullWidth && index == columns() ) 99 if ( m_fullWidth && index == columns() )
103 { 100 {
104 header()->setStretchEnabled( true, columns()-1 ); 101 header()->setStretchEnabled( true, columns()-1 );
105 } 102 }
106 #endif 103 #endif
107} 104}
108 105
109const QColor& OListView::alternateBackground() const 106const QColor& OListView::alternateBackground() const
110{ 107{
111 return m_alternateBackground; 108 return m_alternateBackground;
112} 109}
113 110
114void OListView::setAlternateBackground( const QColor &c ) 111void OListView::setAlternateBackground( const QColor &c )
115{ 112{
116 m_alternateBackground = c; 113 m_alternateBackground = c;
117 repaint(); 114 repaint();
118} 115}
119 116
120const QPen& OListView::columnSeparator() const 117const QPen& OListView::columnSeparator() const
121{ 118{
122 return m_columnSeparator; 119 return m_columnSeparator;
123} 120}
124 121
125void OListView::setColumnSeparator( const QPen& p ) 122void OListView::setColumnSeparator( const QPen& p )
126{ 123{
127 m_columnSeparator = p; 124 m_columnSeparator = p;
128 repaint(); 125 repaint();
129} 126}
130 127
diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp
index ac73188..d5cc575 100644
--- a/libopie2/opieui/opopupmenu.cpp
+++ b/libopie2/opieui/opopupmenu.cpp
@@ -1,126 +1,119 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> 2 Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
3 Copyright (C) 2002 Hamish Rodda <meddie@yoyo.its.monash.edu.au> 3 Copyright (C) 2002 Hamish Rodda <meddie@yoyo.its.monash.edu.au>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation. 7 License version 2 as published by the Free Software Foundation.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20/* QT */ 20/* QT */
21 21
22#include <qapplication.h>
23#include <qcursor.h>
24#include <qpainter.h>
25#include <qdrawutil.h> 22#include <qdrawutil.h>
26#include <qtimer.h> 23#include <qtimer.h>
27#include <qfont.h>
28#include <qfontmetrics.h>
29#include <qregexp.h>
30#include <qstyle.h>
31 24
32/* OPIE */ 25/* OPIE */
33 26
34#include <opie2/opopupmenu.h> 27#include <opie2/opopupmenu.h>
35#include <opie2/oconfig.h> 28#include <opie2/oconfig.h>
36 29
37OPopupTitle::OPopupTitle(QWidget *parent, const char *name) 30OPopupTitle::OPopupTitle(QWidget *parent, const char *name)
38 : QWidget(parent, name) 31 : QWidget(parent, name)
39{ 32{
40 setMinimumSize(16, fontMetrics().height()+8); 33 setMinimumSize(16, fontMetrics().height()+8);
41} 34}
42 35
43OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */, 36OPopupTitle::OPopupTitle(OPixmapEffect::GradientType /* gradient */,
44 const QColor &/* color */, const QColor &/* textColor */, 37 const QColor &/* color */, const QColor &/* textColor */,
45 QWidget *parent, const char *name) 38 QWidget *parent, const char *name)
46 : QWidget(parent, name) 39 : QWidget(parent, name)
47{ 40{
48 setMinimumSize(16, fontMetrics().height()+8); 41 setMinimumSize(16, fontMetrics().height()+8);
49} 42}
50 43
51OPopupTitle::OPopupTitle(const OPixmap & /* background */, const QColor &/* color */, 44OPopupTitle::OPopupTitle(const OPixmap & /* background */, const QColor &/* color */,
52 const QColor &/* textColor */, QWidget *parent, 45 const QColor &/* textColor */, QWidget *parent,
53 const char *name) 46 const char *name)
54 : QWidget(parent, name) 47 : QWidget(parent, name)
55{ 48{
56 setMinimumSize(16, fontMetrics().height()+8); 49 setMinimumSize(16, fontMetrics().height()+8);
57} 50}
58 51
59void OPopupTitle::setTitle(const QString &text, const QPixmap *icon) 52void OPopupTitle::setTitle(const QString &text, const QPixmap *icon)
60{ 53{
61 titleStr = text; 54 titleStr = text;
62 if (icon) 55 if (icon)
63 miniicon = *icon; 56 miniicon = *icon;
64 else 57 else
65 miniicon.resize(0, 0); 58 miniicon.resize(0, 0);
66 59
67 int w = miniicon.width()+fontMetrics().width(titleStr); 60 int w = miniicon.width()+fontMetrics().width(titleStr);
68 int h = QMAX( fontMetrics().height(), miniicon.height() ); 61 int h = QMAX( fontMetrics().height(), miniicon.height() );
69 setMinimumSize( w+16, h+8 ); 62 setMinimumSize( w+16, h+8 );
70} 63}
71 64
72void OPopupTitle::setText( const QString &text ) 65void OPopupTitle::setText( const QString &text )
73{ 66{
74 titleStr = text; 67 titleStr = text;
75 int w = miniicon.width()+fontMetrics().width(titleStr); 68 int w = miniicon.width()+fontMetrics().width(titleStr);
76 int h = QMAX( fontMetrics().height(), miniicon.height() ); 69 int h = QMAX( fontMetrics().height(), miniicon.height() );
77 setMinimumSize( w+16, h+8 ); 70 setMinimumSize( w+16, h+8 );
78} 71}
79 72
80void OPopupTitle::setIcon( const QPixmap &pix ) 73void OPopupTitle::setIcon( const QPixmap &pix )
81{ 74{
82 miniicon = pix; 75 miniicon = pix;
83 int w = miniicon.width()+fontMetrics().width(titleStr); 76 int w = miniicon.width()+fontMetrics().width(titleStr);
84 int h = QMAX( fontMetrics().height(), miniicon.height() ); 77 int h = QMAX( fontMetrics().height(), miniicon.height() );
85 setMinimumSize( w+16, h+8 ); 78 setMinimumSize( w+16, h+8 );
86} 79}
87 80
88void OPopupTitle::paintEvent(QPaintEvent *) 81void OPopupTitle::paintEvent(QPaintEvent *)
89{ 82{
90 QRect r(rect()); 83 QRect r(rect());
91 QPainter p(this); 84 QPainter p(this);
92 #if QT_VERSION > 290 85 #if QT_VERSION > 290
93 qApp->style().drawPrimitive(QStyle::PE_HeaderSection, &p, r, palette().active()); 86 qApp->style().drawPrimitive(QStyle::PE_HeaderSection, &p, r, palette().active());
94 #else 87 #else
95 #warning OPopupMenu is not fully functional on Qt2 88 #warning OPopupMenu is not fully functional on Qt2
96 #endif 89 #endif
97 90
98 if (!miniicon.isNull()) 91 if (!miniicon.isNull())
99 p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon); 92 p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon);
100 93
101 if (!titleStr.isNull()) 94 if (!titleStr.isNull())
102 { 95 {
103 p.setPen(palette().active().text()); 96 p.setPen(palette().active().text());
104 QFont f = p.font(); 97 QFont f = p.font();
105 f.setBold(true); 98 f.setBold(true);
106 p.setFont(f); 99 p.setFont(f);
107 if(!miniicon.isNull()) 100 if(!miniicon.isNull())
108 { 101 {
109 p.drawText(miniicon.width()+8, 0, width()-(miniicon.width()+8), 102 p.drawText(miniicon.width()+8, 0, width()-(miniicon.width()+8),
110 height(), AlignLeft | AlignVCenter | SingleLine, 103 height(), AlignLeft | AlignVCenter | SingleLine,
111 titleStr); 104 titleStr);
112 } 105 }
113 else 106 else
114 { 107 {
115 p.drawText(0, 0, width(), height(), 108 p.drawText(0, 0, width(), height(),
116 AlignCenter | SingleLine, titleStr); 109 AlignCenter | SingleLine, titleStr);
117 } 110 }
118 } 111 }
119 112
120 p.setPen(palette().active().highlight()); 113 p.setPen(palette().active().highlight());
121 p.drawLine(0, 0, r.right(), 0); 114 p.drawLine(0, 0, r.right(), 0);
122} 115}
123 116
124QSize OPopupTitle::sizeHint() const 117QSize OPopupTitle::sizeHint() const
125{ 118{
126 return(minimumSize()); 119 return(minimumSize());
diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp
index ec5af6b..23b3ce3 100644
--- a/libopie2/opieui/oselector.cpp
+++ b/libopie2/opieui/oselector.cpp
@@ -1,119 +1,118 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20/* QT */ 20/* QT */
21 21
22#include <qimage.h> 22#include <qimage.h>
23#include <qpainter.h>
24#include <qdrawutil.h> 23#include <qdrawutil.h>
25 24
26/* OPIE */ 25/* OPIE */
27 26
28#include <opie2/oimageeffect.h> 27#include <opie2/oimageeffect.h>
29#include <opie2/oselector.h> 28#include <opie2/oselector.h>
30 29
31#define STORE_W 8 30#define STORE_W 8
32#define STORE_W2 STORE_W * 2 31#define STORE_W2 STORE_W * 2
33 32
34//----------------------------------------------------------------------------- 33//-----------------------------------------------------------------------------
35/* 34/*
36 * 2D value selector. 35 * 2D value selector.
37 * The contents of the selector are drawn by derived class. 36 * The contents of the selector are drawn by derived class.
38 */ 37 */
39 38
40OXYSelector::OXYSelector( QWidget *parent, const char *name ) 39OXYSelector::OXYSelector( QWidget *parent, const char *name )
41 : QWidget( parent, name ) 40 : QWidget( parent, name )
42{ 41{
43 xPos = 0; 42 xPos = 0;
44 yPos = 0; 43 yPos = 0;
45 minX = 0; 44 minX = 0;
46 minY = 0; 45 minY = 0;
47 maxX = 100; 46 maxX = 100;
48 maxY = 100; 47 maxY = 100;
49 store.setOptimization( QPixmap::BestOptim ); 48 store.setOptimization( QPixmap::BestOptim );
50 store.resize( STORE_W2, STORE_W2 ); 49 store.resize( STORE_W2, STORE_W2 );
51} 50}
52 51
53 52
54OXYSelector::~OXYSelector() 53OXYSelector::~OXYSelector()
55{} 54{}
56 55
57 56
58void OXYSelector::setRange( int _minX, int _minY, int _maxX, int _maxY ) 57void OXYSelector::setRange( int _minX, int _minY, int _maxX, int _maxY )
59{ 58{
60 px = 2; 59 px = 2;
61 py = 2; 60 py = 2;
62 minX = _minX; 61 minX = _minX;
63 minY = _minY; 62 minY = _minY;
64 maxX = _maxX; 63 maxX = _maxX;
65 maxY = _maxY; 64 maxY = _maxY;
66} 65}
67 66
68void OXYSelector::setValues( int _xPos, int _yPos ) 67void OXYSelector::setValues( int _xPos, int _yPos )
69{ 68{
70 xPos = _xPos; 69 xPos = _xPos;
71 yPos = _yPos; 70 yPos = _yPos;
72 71
73 if ( xPos > maxX ) 72 if ( xPos > maxX )
74 xPos = maxX; 73 xPos = maxX;
75 else if ( xPos < minX ) 74 else if ( xPos < minX )
76 xPos = minX; 75 xPos = minX;
77 76
78 if ( yPos > maxY ) 77 if ( yPos > maxY )
79 yPos = maxY; 78 yPos = maxY;
80 else if ( yPos < minY ) 79 else if ( yPos < minY )
81 yPos = minY; 80 yPos = minY;
82 81
83 int xp = 2 + (width() - 4) * xPos / (maxX - minX); 82 int xp = 2 + (width() - 4) * xPos / (maxX - minX);
84 int yp = height() - 2 - (height() - 4) * yPos / (maxY - minY); 83 int yp = height() - 2 - (height() - 4) * yPos / (maxY - minY);
85 84
86 setPosition( xp, yp ); 85 setPosition( xp, yp );
87} 86}
88 87
89QRect OXYSelector::contentsRect() const 88QRect OXYSelector::contentsRect() const
90{ 89{
91 return QRect( 2, 2, width()-4, height()-4 ); 90 return QRect( 2, 2, width()-4, height()-4 );
92} 91}
93 92
94void OXYSelector::paintEvent( QPaintEvent *ev ) 93void OXYSelector::paintEvent( QPaintEvent *ev )
95{ 94{
96 QRect cursorRect( px - STORE_W, py - STORE_W, STORE_W2, STORE_W2); 95 QRect cursorRect( px - STORE_W, py - STORE_W, STORE_W2, STORE_W2);
97 QRect paintRect = ev->rect(); 96 QRect paintRect = ev->rect();
98 97
99 QPainter painter; 98 QPainter painter;
100 painter.begin( this ); 99 painter.begin( this );
101 100
102 QBrush brush; 101 QBrush brush;
103 qDrawShadePanel( &painter, 0, 0, width(), height(), colorGroup(), 102 qDrawShadePanel( &painter, 0, 0, width(), height(), colorGroup(),
104 TRUE, 2, &brush ); 103 TRUE, 2, &brush );
105 104
106 drawContents( &painter ); 105 drawContents( &painter );
107 if (paintRect.contains(cursorRect)) 106 if (paintRect.contains(cursorRect))
108 { 107 {
109 bitBlt( &store, 0, 0, this, px - STORE_W, py - STORE_W, 108 bitBlt( &store, 0, 0, this, px - STORE_W, py - STORE_W,
110 STORE_W2, STORE_W2, CopyROP ); 109 STORE_W2, STORE_W2, CopyROP );
111 drawCursor( &painter, px, py ); 110 drawCursor( &painter, px, py );
112 } 111 }
113 else if (paintRect.intersects(cursorRect)) 112 else if (paintRect.intersects(cursorRect))
114 { 113 {
115 repaint( cursorRect, false); 114 repaint( cursorRect, false);
116 } 115 }
117 116
118 painter.end(); 117 painter.end();
119} 118}
diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp
index 98d42c7..b93c225 100644
--- a/libopie2/opieui/oseparator.cpp
+++ b/libopie2/opieui/oseparator.cpp
@@ -1,128 +1,127 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3              Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 3              Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
4 Copyright (C) 1997 Michael Roth <mroth@wirlweb.de> 4 Copyright (C) 1997 Michael Roth <mroth@wirlweb.de>
5 =. 5 =.
6 .=l. 6 .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This program is free software; you can 8 _;:,     .>    :=|. This program is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under 9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32/* OPIE */ 32/* OPIE */
33 33
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35#include <opie2/oseparator.h> 35#include <opie2/oseparator.h>
36 36
37/* QT */ 37/* QT */
38 38
39#include <qstyle.h>
40 39
41OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) 40OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f)
42 : QFrame(parent, name, f) 41 : QFrame(parent, name, f)
43{ 42{
44 setLineWidth(1); 43 setLineWidth(1);
45 setMidLineWidth(0); 44 setMidLineWidth(0);
46 setOrientation( HLine ); 45 setOrientation( HLine );
47} 46}
48 47
49 48
50 49
51OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) 50OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f)
52 : QFrame(parent, name, f) 51 : QFrame(parent, name, f)
53{ 52{
54 setLineWidth(1); 53 setLineWidth(1);
55 setMidLineWidth(0); 54 setMidLineWidth(0);
56 setOrientation( orientation ); 55 setOrientation( orientation );
57} 56}
58 57
59 58
60 59
61void OSeparator::setOrientation(int orientation) 60void OSeparator::setOrientation(int orientation)
62{ 61{
63 switch(orientation) 62 switch(orientation)
64 { 63 {
65 case Vertical: 64 case Vertical:
66 case VLine: 65 case VLine:
67 setFrameStyle( QFrame::VLine | QFrame::Sunken ); 66 setFrameStyle( QFrame::VLine | QFrame::Sunken );
68 setMinimumSize(2, 0); 67 setMinimumSize(2, 0);
69 break; 68 break;
70 69
71 default: 70 default:
72 owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; 71 owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl;
73 72
74 case Horizontal: 73 case Horizontal:
75 case HLine: 74 case HLine:
76 setFrameStyle( QFrame::HLine | QFrame::Sunken ); 75 setFrameStyle( QFrame::HLine | QFrame::Sunken );
77 setMinimumSize(0, 2); 76 setMinimumSize(0, 2);
78 break; 77 break;
79 } 78 }
80} 79}
81 80
82 81
83 82
84int OSeparator::orientation() const 83int OSeparator::orientation() const
85{ 84{
86 if ( frameStyle() & VLine ) 85 if ( frameStyle() & VLine )
87 return VLine; 86 return VLine;
88 87
89 if ( frameStyle() & HLine ) 88 if ( frameStyle() & HLine )
90 return HLine; 89 return HLine;
91 90
92 return 0; 91 return 0;
93} 92}
94 93
95void OSeparator::drawFrame(QPainter *p) 94void OSeparator::drawFrame(QPainter *p)
96{ 95{
97 QPointp1, p2; 96 QPointp1, p2;
98 QRectr = frameRect(); 97 QRectr = frameRect();
99 const QColorGroup & g = colorGroup(); 98 const QColorGroup & g = colorGroup();
100 99
101 if ( frameStyle() & HLine ) { 100 if ( frameStyle() & HLine ) {
102 p1 = QPoint( r.x(), r.height()/2 ); 101 p1 = QPoint( r.x(), r.height()/2 );
103 p2 = QPoint( r.x()+r.width(), p1.y() ); 102 p2 = QPoint( r.x()+r.width(), p1.y() );
104 } 103 }
105 else { 104 else {
106 p1 = QPoint( r.x()+r.width()/2, 0 ); 105 p1 = QPoint( r.x()+r.width()/2, 0 );
107 p2 = QPoint( p1.x(), r.height() ); 106 p2 = QPoint( p1.x(), r.height() );
108 } 107 }
109 108
110#if QT_VERSION < 300 109#if QT_VERSION < 300
111 style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); 110 style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() );
112#else 111#else
113 QStyleOption opt( lineWidth(), midLineWidth() ); 112 QStyleOption opt( lineWidth(), midLineWidth() );
114 style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); 113 style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt );
115#endif 114#endif
116} 115}
117 116
118 117
119QSize OSeparator::sizeHint() const 118QSize OSeparator::sizeHint() const
120{ 119{
121 if ( frameStyle() & VLine ) 120 if ( frameStyle() & VLine )
122 return QSize(2, 0); 121 return QSize(2, 0);
123 122
124 if ( frameStyle() & HLine ) 123 if ( frameStyle() & HLine )
125 return QSize(0, 2); 124 return QSize(0, 2);
126 125
127 return QSize(-1, -1); 126 return QSize(-1, -1);
128} 127}
diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp
index 9f9f2c2..d4712a4 100644
--- a/libopie2/opieui/otimepicker.cpp
+++ b/libopie2/opieui/otimepicker.cpp
@@ -1,131 +1,128 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de> 3 Copyright (C) Stefan Eilers <eilers.stefan@epost.de>
4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org> 4 =. Copyright (C) The Opie Team <opie-devel@handhelds.org>
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
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/* QT */ 30/* QT */
31#include <qbuttongroup.h>
32#include <qlayout.h> 31#include <qlayout.h>
33#include <qlineedit.h> 32#include <qlineedit.h>
34#include <qstring.h>
35#include <qtoolbutton.h>
36 33
37/* OPIE */ 34/* OPIE */
38#include <opie2/otimepicker.h> 35#include <opie2/otimepicker.h>
39 36
40using namespace Opie; 37using namespace Opie;
41 38
42/** 39/**
43 * Constructs the widget 40 * Constructs the widget
44 * @param parent The parent of the OTimePicker 41 * @param parent The parent of the OTimePicker
45 * @param name The name of the object 42 * @param name The name of the object
46 * @param fl Window Flags 43 * @param fl Window Flags
47 */ 44 */
48OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl) 45OTimePicker::OTimePicker(QWidget* parent, const char* name, Qt::WFlags fl)
49 :QWidget(parent,name,fl) 46 :QWidget(parent,name,fl)
50{ 47{
51 QVBoxLayout *vbox=new QVBoxLayout(this); 48 QVBoxLayout *vbox=new QVBoxLayout(this);
52 49
53 OClickableLabel *r; 50 OClickableLabel *r;
54 QString s; 51 QString s;
55 52
56 // Hour Row 53 // Hour Row
57 QWidget *row=new QWidget(this); 54 QWidget *row=new QWidget(this);
58 QHBoxLayout *l=new QHBoxLayout(row); 55 QHBoxLayout *l=new QHBoxLayout(row);
59 vbox->addWidget(row); 56 vbox->addWidget(row);
60 57
61 for (int i=0; i<24; i++) 58 for (int i=0; i<24; i++)
62 { 59 {
63 r=new OClickableLabel(row); 60 r=new OClickableLabel(row);
64 hourLst.append(r); 61 hourLst.append(r);
65 s.sprintf("%.2d",i); 62 s.sprintf("%.2d",i);
66 r->setText(s); 63 r->setText(s);
67 r->setToggleButton(true); 64 r->setToggleButton(true);
68 r->setAlignment(AlignHCenter | AlignVCenter); 65 r->setAlignment(AlignHCenter | AlignVCenter);
69 l->addWidget(r); 66 l->addWidget(r);
70 connect(r, SIGNAL(toggled(bool)), 67 connect(r, SIGNAL(toggled(bool)),
71 this, SLOT(slotHour(bool))); 68 this, SLOT(slotHour(bool)));
72 69
73 if (i==11) 70 if (i==11)
74 { // Second row 71 { // Second row
75 row=new QWidget(this); 72 row=new QWidget(this);
76 l=new QHBoxLayout(row); 73 l=new QHBoxLayout(row);
77 vbox->addWidget(row); 74 vbox->addWidget(row);
78 } 75 }
79 } 76 }
80 77
81 // Minute Row 78 // Minute Row
82 row=new QWidget(this); 79 row=new QWidget(this);
83 l=new QHBoxLayout(row); 80 l=new QHBoxLayout(row);
84 vbox->addWidget(row); 81 vbox->addWidget(row);
85 82
86 for (int i=0; i<60; i+=5) 83 for (int i=0; i<60; i+=5)
87 { 84 {
88 r=new OClickableLabel(row); 85 r=new OClickableLabel(row);
89 minuteLst.append(r); 86 minuteLst.append(r);
90 s.sprintf("%.2d",i); 87 s.sprintf("%.2d",i);
91 r->setText(s); 88 r->setText(s);
92 r->setToggleButton(true); 89 r->setToggleButton(true);
93 r->setAlignment(AlignHCenter | AlignVCenter); 90 r->setAlignment(AlignHCenter | AlignVCenter);
94 l->addWidget(r); 91 l->addWidget(r);
95 connect(r, SIGNAL(toggled(bool)), 92 connect(r, SIGNAL(toggled(bool)),
96 this, SLOT(slotMinute(bool))); 93 this, SLOT(slotMinute(bool)));
97 } 94 }
98} 95}
99 96
100/** 97/**
101 * This method return the current time 98 * This method return the current time
102 * @return the time 99 * @return the time
103 */ 100 */
104QTime OTimePicker::time()const 101QTime OTimePicker::time()const
105{ 102{
106 return tm; 103 return tm;
107} 104}
108 105
109void OTimePicker::slotHour(bool b) 106void OTimePicker::slotHour(bool b)
110{ 107{
111 108
112 OClickableLabel *r = (OClickableLabel *) sender(); 109 OClickableLabel *r = (OClickableLabel *) sender();
113 110
114 if (b) 111 if (b)
115 { 112 {
116 QValueListIterator<OClickableLabel *> it; 113 QValueListIterator<OClickableLabel *> it;
117 for (it=hourLst.begin(); it!=hourLst.end(); it++) 114 for (it=hourLst.begin(); it!=hourLst.end(); it++)
118 { 115 {
119 if (*it != r) (*it)->setOn(false); 116 if (*it != r) (*it)->setOn(false);
120 else tm.setHMS((*it)->text().toInt(), tm.minute(), 0); 117 else tm.setHMS((*it)->text().toInt(), tm.minute(), 0);
121 } 118 }
122 emit timeChanged(tm); 119 emit timeChanged(tm);
123 } 120 }
124 else 121 else
125 { 122 {
126 r->setOn(true); 123 r->setOn(true);
127 } 124 }
128 125
129} 126}
130 127
131void OTimePicker::slotMinute(bool b) 128void OTimePicker::slotMinute(bool b)
diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp
index 65fe3d8..8839456 100644
--- a/libopie2/opieui/oversatileview.cpp
+++ b/libopie2/opieui/oversatileview.cpp
@@ -1,148 +1,137 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 3
4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 4 =. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
5 .=l. 5 .=l.
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can 7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
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 30
31/* OPIE */ 31/* OPIE */
32 32
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34#include <opie2/oversatileview.h> 34#include <opie2/oversatileview.h>
35#include <opie2/oversatileviewitem.h> 35#include <opie2/oversatileviewitem.h>
36#include <opie2/olistview.h> 36#include <opie2/olistview.h>
37 37
38/* QT */ 38/* QT */
39 39
40#include <qaction.h> 40#include <qaction.h>
41#include <qbrush.h>
42#include <qfont.h>
43#include <qiconset.h>
44#include <qiconview.h>
45#include <qlistview.h>
46#include <qpalette.h>
47#include <qpoint.h>
48#include <qpopupmenu.h> 41#include <qpopupmenu.h>
49#include <qrect.h>
50#include <qsize.h>
51#include <qstring.h>
52#include <qwidgetstack.h>
53 42
54/* XPM */ 43/* XPM */
55static const char * view_icon_xpm[] = { 44static const char * view_icon_xpm[] = {
56"16 16 16 1", 45"16 16 16 1",
57 " c None", 46 " c None",
58 ".c #87BD88", 47 ".c #87BD88",
59 "+c #8BBE8B", 48 "+c #8BBE8B",
60 "@c #81BA81", 49 "@c #81BA81",
61 "#c #6DAF6D", 50 "#c #6DAF6D",
62 "$c #87BD87", 51 "$c #87BD87",
63 "%c #FCFDFC", 52 "%c #FCFDFC",
64 "&c #AED0AE", 53 "&c #AED0AE",
65 "*c #4E9C4C", 54 "*c #4E9C4C",
66 "=c #91BD91", 55 "=c #91BD91",
67 "-c #72B172", 56 "-c #72B172",
68 ";c #448643", 57 ";c #448643",
69 ">c #519F50", 58 ">c #519F50",
70 ",c #499247", 59 ",c #499247",
71 "'c #356A35", 60 "'c #356A35",
72 ")c #686868", 61 ")c #686868",
73" ", 62" ",
74" .+@# .+@# ", 63" .+@# .+@# ",
75" $%&* $%&* ", 64" $%&* $%&* ",
76" @=-; @=-; ", 65" @=-; @=-; ",
77" #>,' #>,' ", 66" #>,' #>,' ",
78" ", 67" ",
79" )))))) )))))) ", 68" )))))) )))))) ",
80" ", 69" ",
81" ", 70" ",
82" .+@# .+@# ", 71" .+@# .+@# ",
83" $%&* $%&* ", 72" $%&* $%&* ",
84" @=-; @=-; ", 73" @=-; @=-; ",
85" #>,' #>,' ", 74" #>,' #>,' ",
86" ", 75" ",
87" )))))) )))))) ", 76" )))))) )))))) ",
88" "}; 77" "};
89 78
90/* XPM */ 79/* XPM */
91static const char * view_tree_xpm[] = { 80static const char * view_tree_xpm[] = {
92"16 16 17 1", 81"16 16 17 1",
93 " c None", 82 " c None",
94 ".c #3A3A3A", 83 ".c #3A3A3A",
95 "+c #87BD88", 84 "+c #87BD88",
96 "@c #8BBE8B", 85 "@c #8BBE8B",
97 "#c #81BA81", 86 "#c #81BA81",
98 "$c #6DAF6D", 87 "$c #6DAF6D",
99 "%c #87BD87", 88 "%c #87BD87",
100 "&c #FCFDFC", 89 "&c #FCFDFC",
101 "*c #AED0AE", 90 "*c #AED0AE",
102 "=c #4E9C4C", 91 "=c #4E9C4C",
103 "-c #91BD91", 92 "-c #91BD91",
104 ";c #72B172", 93 ";c #72B172",
105 ">c #448643", 94 ">c #448643",
106 ",c #686868", 95 ",c #686868",
107 "'c #519F50", 96 "'c #519F50",
108 ")c #499247", 97 ")c #499247",
109 "!c #356A35", 98 "!c #356A35",
110" . ", 99" . ",
111" . ", 100" . ",
112" . +@#$ ", 101" . +@#$ ",
113" . %&*= ", 102" . %&*= ",
114" .. #-;> ,, ,,,", 103" .. #-;> ,, ,,,",
115" . $')! ", 104" . $')! ",
116" . ", 105" . ",
117" . ", 106" . ",
118" . ", 107" . ",
119" . +@#$ ", 108" . +@#$ ",
120" . %&*= ", 109" . %&*= ",
121" .. #-;> ,, ,,,", 110" .. #-;> ,, ,,,",
122" $')! ", 111" $')! ",
123" ", 112" ",
124" ", 113" ",
125" "}; 114" "};
126 115
127OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) 116OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode )
128 :QWidgetStack( parent, name ), 117 :QWidgetStack( parent, name ),
129 _viewmode( mode ), _warningpolicy( None ), 118 _viewmode( mode ), _warningpolicy( None ),
130 _treeleaf(), _treeopened(), _treeclosed(), 119 _treeleaf(), _treeopened(), _treeclosed(),
131 _iconleaf(), _iconopened(), _iconclosed() 120 _iconleaf(), _iconopened(), _iconclosed()
132{ 121{
133 // 122 //
134 // Create child widgets and set some reasonable default styles 123 // Create child widgets and set some reasonable default styles
135 // 124 //
136 125
137 _listview = new OListView( this, "oversatileview embedded listview" ); 126 _listview = new OListView( this, "oversatileview embedded listview" );
138 _iconview = new QIconView( this, "oversatileview embedded iconview" ); 127 _iconview = new QIconView( this, "oversatileview embedded iconview" );
139 128
140 _listview->setAllColumnsShowFocus( true ); 129 _listview->setAllColumnsShowFocus( true );
141 _listview->setRootIsDecorated( true ); 130 _listview->setRootIsDecorated( true );
142 _listview->setShowSortIndicator( true ); 131 _listview->setShowSortIndicator( true );
143 _iconview->setGridX( 90 ); 132 _iconview->setGridX( 90 );
144 _iconview->setGridY( 42 ); 133 _iconview->setGridY( 42 );
145 _iconview->setAutoArrange( true ); 134 _iconview->setAutoArrange( true );
146 135
147 #ifdef QWS // TODO: Let this depend on current geometry (rotation) 136 #ifdef QWS // TODO: Let this depend on current geometry (rotation)
148 _iconview->setArrangement( QIconView::TopToBottom ); 137 _iconview->setArrangement( QIconView::TopToBottom );