summaryrefslogtreecommitdiff
authorar <ar>2004-05-31 15:26:50 (UTC)
committer ar <ar>2004-05-31 15:26:50 (UTC)
commit27dfc34d411dee76f09f5e516c60b0a64eb35948 (patch) (unidiff)
treeb7f7259497630390e352a1257cac5dc59f5399a6
parent27b09fe4f930b96e82cea9fb0eb1a9b87f7ec062 (diff)
downloadopie-27dfc34d411dee76f09f5e516c60b0a64eb35948.zip
opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.gz
opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.bz2
- convert qWarning to owarn
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext_p.h5
-rw-r--r--noncore/apps/tableviewer/browsekeyentry.cpp11
-rw-r--r--noncore/apps/tableviewer/db/common.cpp7
-rw-r--r--noncore/apps/tableviewer/db/datacache.cpp2
-rw-r--r--noncore/apps/tableviewer/db/datacache.h12
-rw-r--r--noncore/apps/tableviewer/ui/browsekeyentry.cpp9
-rw-r--r--noncore/apps/tableviewer/ui/filterkeyentry.cpp8
-rw-r--r--noncore/apps/tableviewer/ui/tvfilterview.cpp11
-rw-r--r--noncore/apps/tinykate/libkate/kateconfig.cpp4
-rw-r--r--noncore/apps/zsafe/main.cpp15
-rw-r--r--noncore/apps/zsafe/zlistview.cpp11
-rw-r--r--noncore/apps/zsafe/zsafe.cpp51
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp24
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp6
-rw-r--r--noncore/graphics/opie-eye/gui/viewmodebutton.cpp5
-rw-r--r--noncore/net/opietooth/lib/device.cc55
-rw-r--r--noncore/net/opietooth/lib/manager.cc65
-rw-r--r--noncore/net/opietooth/lib/parser.cc60
-rw-r--r--noncore/settings/mediummount/mediumglobal.cc11
-rw-r--r--noncore/styles/theme/othemebase.h7
20 files changed, 209 insertions, 170 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.h b/noncore/apps/opie-write/qrichtext_p.h
index e368edb..3778feb 100644
--- a/noncore/apps/opie-write/qrichtext_p.h
+++ b/noncore/apps/opie-write/qrichtext_p.h
@@ -41,24 +41,27 @@
41// 41//
42// W A R N I N G 42// W A R N I N G
43// ------------- 43// -------------
44// 44//
45// This file is not part of the Qt API. It exists for the convenience 45// This file is not part of the Qt API. It exists for the convenience
46// of a number of Qt sources files. This header file may change from 46// of a number of Qt sources files. This header file may change from
47// version to version without notice, or even be removed. 47// version to version without notice, or even be removed.
48// 48//
49// We mean it. 49// We mean it.
50// 50//
51// 51//
52 52
53#include <opie2/odebug.h>
54using namespace Opie::Core;
55
53#ifndef QT_H 56#ifndef QT_H
54#include "qstring.h" 57#include "qstring.h"
55#include "qlist.h" 58#include "qlist.h"
56#include "qrect.h" 59#include "qrect.h"
57#include "qfontmetrics.h" 60#include "qfontmetrics.h"
58#include "qintdict.h" 61#include "qintdict.h"
59#include "qmap.h" 62#include "qmap.h"
60#include "qstringlist.h" 63#include "qstringlist.h"
61#include "qfont.h" 64#include "qfont.h"
62#include "qcolor.h" 65#include "qcolor.h"
63#include "qsize.h" 66#include "qsize.h"
64#include "qvaluelist.h" 67#include "qvaluelist.h"
@@ -1874,25 +1877,25 @@ inline int QTextParagraph::endState() const
1874{ 1877{
1875 return state; 1878 return state;
1876} 1879}
1877 1880
1878inline void QTextParagraph::setParagId( int i ) 1881inline void QTextParagraph::setParagId( int i )
1879{ 1882{
1880 id = i; 1883 id = i;
1881} 1884}
1882 1885
1883inline int QTextParagraph::paragId() const 1886inline int QTextParagraph::paragId() const
1884{ 1887{
1885 if ( id == -1 ) 1888 if ( id == -1 )
1886 qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); 1889 owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl;
1887 return id; 1890 return id;
1888} 1891}
1889 1892
1890inline bool QTextParagraph::firstPreProcess() const 1893inline bool QTextParagraph::firstPreProcess() const
1891{ 1894{
1892 return firstPProcess; 1895 return firstPProcess;
1893} 1896}
1894 1897
1895inline void QTextParagraph::setFirstPreProcess( bool b ) 1898inline void QTextParagraph::setFirstPreProcess( bool b )
1896{ 1899{
1897 firstPProcess = b; 1900 firstPProcess = b;
1898} 1901}
diff --git a/noncore/apps/tableviewer/browsekeyentry.cpp b/noncore/apps/tableviewer/browsekeyentry.cpp
index 04e7902..bab9af6 100644
--- a/noncore/apps/tableviewer/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/browsekeyentry.cpp
@@ -10,36 +10,38 @@
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "browsekeyentry.h" 20#include "browsekeyentry.h"
21 21
22/* OPIE */
23#include <opie2/odebug.h>
24using namespace Opie::Core;
25
26/* QT */
22#include <qtoolbutton.h> 27#include <qtoolbutton.h>
23#include <qwidgetstack.h> 28#include <qwidgetstack.h>
24#include <qlayout.h> 29#include <qlayout.h>
25#include <qlineedit.h> 30#include <qlineedit.h>
26#include <qpushbutton.h> 31#include <qpushbutton.h>
27#include <qpopupmenu.h> 32#include <qpopupmenu.h>
28#include <qhbox.h> 33#include <qhbox.h>
29#include <qdatetime.h> 34#include <qdatetime.h>
30 35
31//#include <iostream.h>
32#include <qheader.h>
33// For qWarning(const char *)
34 36
35/*! 37/*!
36 \class TVBrowseKeyEntry 38 \class TVBrowseKeyEntry
37 \brief a Widget used enter keys into the TVBrowseViewWidget 39 \brief a Widget used enter keys into the TVBrowseViewWidget
38 40
39 The TVBrowseKeyEntry Widget provides the facility to enter 41 The TVBrowseKeyEntry Widget provides the facility to enter
40 various key types to be search on in the table. The key can be changed 42 various key types to be search on in the table. The key can be changed
41 and the entry field will update to the correct sort of widget appropriately 43 and the entry field will update to the correct sort of widget appropriately
42*/ 44*/
43 45
44/*! 46/*!
45 Constructs the widget 47 Constructs the widget
@@ -219,24 +221,23 @@ void TVBrowseKeyEntry::searchOnText()
219 m = monthKey->text().toInt(&ok); 221 m = monthKey->text().toInt(&ok);
220 if (!ok) 222 if (!ok)
221 return; 223 return;
222 y = yearKey->text().toInt(&ok); 224 y = yearKey->text().toInt(&ok);
223 if (!ok) 225 if (!ok)
224 return; 226 return;
225 if(!QDate::isValid(y, m, d)) 227 if(!QDate::isValid(y, m, d))
226 return; 228 return;
227 sendkey = (void *) new QDate(y, m, d); 229 sendkey = (void *) new QDate(y, m, d);
228 break; 230 break;
229 } 231 }
230 default: 232 default:
231 qWarning("TVBrowseKeyEntry::searchOnText() " 233 owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
232 "cannot work out data type");
233 return; 234 return;
234 } 235 }
235 emit searchOnKey(ts->current_column, sendkey); 236 emit searchOnKey(ts->current_column, sendkey);
236} 237}
237 238
238/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, void *v) 239/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, void *v)
239 240
240 This signal indicates that a search on key index currentKeyId should be 241 This signal indicates that a search on key index currentKeyId should be
241 done searching for the value v. 242 done searching for the value v.
242*/ 243*/
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp
index b58af85..c35dbea 100644
--- a/noncore/apps/tableviewer/db/common.cpp
+++ b/noncore/apps/tableviewer/db/common.cpp
@@ -851,26 +851,25 @@ int KeyList::addKey(QString name, TVVariant::KeyType type)
851 return addKey(name, TVVariant("<undefined>").asString()); 851 return addKey(name, TVVariant("<undefined>").asString());
852 break; 852 break;
853 case TVVariant::Date: 853 case TVVariant::Date:
854 return addKey(name, TVVariant(QDate::currentDate()).asDate()); 854 return addKey(name, TVVariant(QDate::currentDate()).asDate());
855 break; 855 break;
856 case TVVariant::Time: 856 case TVVariant::Time:
857 return addKey(name, TVVariant(QTime(0,0,0)).toTime()); 857 return addKey(name, TVVariant(QTime(0,0,0)).toTime());
858 break; 858 break;
859 case TVVariant::Int: 859 case TVVariant::Int:
860 return addKey(name, TVVariant(0).toInt()); 860 return addKey(name, TVVariant(0).toInt());
861 break; 861 break;
862 default: 862 default:
863 qWarning(QObject::tr("KeyList::addKey() Cannot make default " 863 owarn << "KeyList::addKey() Cannot make default value for type " << type << ", Key not added." << oendl;
864 "value for type %1, Key not added.").arg(type));
865 break; 864 break;
866 } 865 }
867 return -1; 866 return -1;
868} 867}
869 868
870void KeyList::setKeyFlags(int i, int flag) 869void KeyList::setKeyFlags(int i, int flag)
871{ 870{
872 if(find(i)) 871 if(find(i))
873 find(i)->setFlags(flag); 872 find(i)->setFlags(flag);
874} 873}
875 874
876int KeyList::getKeyFlags(int i) const 875int KeyList::getKeyFlags(int i) const
@@ -1199,27 +1198,25 @@ void DataElem::setField(int i, QString q)
1199 } 1198 }
1200 case TVVariant::Date: { 1199 case TVVariant::Date: {
1201 t.asDate(); 1200 t.asDate();
1202 setField(i, t); 1201 setField(i, t);
1203 return; 1202 return;
1204 } 1203 }
1205 case TVVariant::Time: { 1204 case TVVariant::Time: {
1206 t.asTime(); 1205 t.asTime();
1207 setField(i, t); 1206 setField(i, t);
1208 return; 1207 return;
1209 } 1208 }
1210 default: 1209 default:
1211 qWarning( 1210 owarn << "DataElem::setField(" << i << ", " << q << ") No valid type found" << oendl;
1212 QObject::tr("DataElem::setField(%1, %2) No valid type found").arg(i).arg(q)
1213 );
1214 } 1211 }
1215} 1212}
1216 1213
1217/*! 1214/*!
1218 Sets the value of the elements field index i to the value at the pointer 1215 Sets the value of the elements field index i to the value at the pointer
1219 value. 1216 value.
1220 1217
1221 \param i index of the field to set 1218 \param i index of the field to set
1222 \param value a pointer to the (already allocated) value to set 1219 \param value a pointer to the (already allocated) value to set
1223*/ 1220*/
1224void DataElem::setField(int i, TVVariant value) 1221void DataElem::setField(int i, TVVariant value)
1225{ 1222{
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp
index 6380e1b..de57961 100644
--- a/noncore/apps/tableviewer/db/datacache.cpp
+++ b/noncore/apps/tableviewer/db/datacache.cpp
@@ -147,25 +147,25 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source)
147 has already reached the maximum allowable size this function does not alter 147 has already reached the maximum allowable size this function does not alter
148 the database. 148 the database.
149 149
150 \param delm An already allocated and initialized data element to be added 150 \param delm An already allocated and initialized data element to be added
151*/ 151*/
152void DBStore::addItem(DataElem *delem) 152void DBStore::addItem(DataElem *delem)
153{ 153{
154 addItemInternal(delem); 154 addItemInternal(delem);
155} 155}
156 156
157void DBStore::addItemInternal(DataElem *delem) 157void DBStore::addItemInternal(DataElem *delem)
158{ 158{
159 /* if already full, don't over fill, do a qWarning though */ 159 /* if already full, don't over fill, do a owarn though */
160 if (full) { 160 if (full) {
161 owarn << "Attempted to add items to already full table" << oendl; 161 owarn << "Attempted to add items to already full table" << oendl;
162 return; 162 return;
163 } 163 }
164 164
165 master_table.insert(number_elems, delem); 165 master_table.insert(number_elems, delem);
166 166
167 current_elem = number_elems; 167 current_elem = number_elems;
168 number_elems++; 168 number_elems++;
169 169
170 if(number_elems >= table_size) { 170 if(number_elems >= table_size) {
171 /* filled current table, double if we can */ 171 /* filled current table, double if we can */
diff --git a/noncore/apps/tableviewer/db/datacache.h b/noncore/apps/tableviewer/db/datacache.h
index c5dc637..e38050c 100644
--- a/noncore/apps/tableviewer/db/datacache.h
+++ b/noncore/apps/tableviewer/db/datacache.h
@@ -18,48 +18,54 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21/* 21/*
22 * This file is used to load the xml files that represent the database. 22 * This file is used to load the xml files that represent the database.
23 * The main requirment for said file is each data entry must contain a key, 23 * The main requirment for said file is each data entry must contain a key,
24 * otherwise any other data headings are allowed. 24 * otherwise any other data headings are allowed.
25 */ 25 */
26 26
27#ifndef __DATACACHE_H__ 27#ifndef __DATACACHE_H__
28#define __DATACACHE_H__ 28#define __DATACACHE_H__
29 29
30#include "common.h"
31
32/* OPIE */
33#include <opie2/odebug.h>
34using namespace Opie::Core;
35
36/* QT */
30#include <qstring.h> 37#include <qstring.h>
31#include <qvector.h> 38#include <qvector.h>
32#include "common.h"
33 39
34class DBStore; 40class DBStore;
35 41
36/*! Abstract class that defines how database stuff can be accessed */ 42/*! Abstract class that defines how database stuff can be accessed */
37class DBAccess { 43class DBAccess {
38public: 44public:
39 45
40// DBAccess(DBStore *d) { dstore = d; } 46// DBAccess(DBStore *d) { dstore = d; }
41 virtual ~DBAccess() {} 47 virtual ~DBAccess() {}
42 48
43 virtual QString type() { 49 virtual QString type() {
44 return QString(); 50 return QString();
45 } 51 }
46 52
47 virtual bool openSource(QIODevice *) { 53 virtual bool openSource(QIODevice *) {
48 qWarning("DBAccess::openSource not yet implemented"); 54 owarn << "DBAccess::openSource not yet implemented" << oendl;
49 return false; 55 return false;
50 } 56 }
51 57
52 virtual bool saveSource(QIODevice *) { 58 virtual bool saveSource(QIODevice *) {
53 qWarning("DBAccess::saveSource(QString) not yet implemented"); 59 owarn << "DBAccess::saveSource(QString) not yet implemented" << oendl;
54 return false; 60 return false;
55 } 61 }
56 62
57protected: 63protected:
58 DBStore *dstore; 64 DBStore *dstore;
59 QString source_name; 65 QString source_name;
60}; 66};
61 67
62class DBStore { 68class DBStore {
63public: 69public:
64 DBStore(); 70 DBStore();
65 ~DBStore(); 71 ~DBStore();
diff --git a/noncore/apps/tableviewer/ui/browsekeyentry.cpp b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
index 42e24dd..6b78437 100644
--- a/noncore/apps/tableviewer/ui/browsekeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/browsekeyentry.cpp
@@ -11,36 +11,36 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "browsekeyentry.h" 20#include "browsekeyentry.h"
21#include "commonwidgets.h" 21#include "commonwidgets.h"
22 22
23#include <opie2/odebug.h>
24using namespace Opie::Core;
25
23#include <qtoolbutton.h> 26#include <qtoolbutton.h>
24#include <qwidgetstack.h> 27#include <qwidgetstack.h>
25#include <qlayout.h> 28#include <qlayout.h>
26#include <qlineedit.h> 29#include <qlineedit.h>
27#include <qpushbutton.h> 30#include <qpushbutton.h>
28#include <qpopupmenu.h> 31#include <qpopupmenu.h>
29#include <qhbox.h> 32#include <qhbox.h>
30#include <qdatetime.h> 33#include <qdatetime.h>
31 34
32#include <qheader.h>
33// For qWarning(const char *)
34
35/*! 35/*!
36 \class TVBrowseKeyEntry 36 \class TVBrowseKeyEntry
37 \brief a Widget used enter keys into the TVBrowseViewWidget 37 \brief a Widget used enter keys into the TVBrowseViewWidget
38 38
39 The TVBrowseKeyEntry Widget provides the facility to enter 39 The TVBrowseKeyEntry Widget provides the facility to enter
40 various key types to be search on in the table. The key can be changed 40 various key types to be search on in the table. The key can be changed
41 and the entry field will update to the correct sort of widget appropriately 41 and the entry field will update to the correct sort of widget appropriately
42*/ 42*/
43 43
44/*! 44/*!
45 Constructs the widget 45 Constructs the widget
46*/ 46*/
@@ -183,24 +183,23 @@ void TVBrowseKeyEntry::searchOnText()
183 } 183 }
184 case TVVariant::Time: { 184 case TVVariant::Time: {
185 sendkey = TVVariant(QTime(timeKey->time())); 185 sendkey = TVVariant(QTime(timeKey->time()));
186 break; 186 break;
187 } 187 }
188 case TVVariant::Date: { 188 case TVVariant::Date: {
189 sendkey = TVVariant(QDate(dateKey->date())); 189 sendkey = TVVariant(QDate(dateKey->date()));
190 break; 190 break;
191 } 191 }
192 case TVVariant::Invalid: 192 case TVVariant::Invalid:
193 break; 193 break;
194 default: 194 default:
195 qWarning("TVBrowseKeyEntry::searchOnText() " 195 owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl;
196 "cannot work out data type");
197 return; 196 return;
198 } 197 }
199 emit searchOnKey(ts->current_column, sendkey); 198 emit searchOnKey(ts->current_column, sendkey);
200} 199}
201 200
202/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, TVVariant) 201/*! \fn void TVBrowseKeyEntry::searchOnKey(int currentKeyId, TVVariant)
203 202
204 This signal indicates that a search on key index currentKeyId should be 203 This signal indicates that a search on key index currentKeyId should be
205 done searching for the value v. 204 done searching for the value v.
206*/ 205*/
diff --git a/noncore/apps/tableviewer/ui/filterkeyentry.cpp b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
index d108fbd..4d74d6b 100644
--- a/noncore/apps/tableviewer/ui/filterkeyentry.cpp
+++ b/noncore/apps/tableviewer/ui/filterkeyentry.cpp
@@ -11,24 +11,29 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "filterkeyentry.h" 20#include "filterkeyentry.h"
21#include "commonwidgets.h" 21#include "commonwidgets.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
25using namespace Opie::Core;
26
27/* QT */
23#include <qwidgetstack.h> 28#include <qwidgetstack.h>
24#include <qcombobox.h> 29#include <qcombobox.h>
25#include <qlayout.h> 30#include <qlayout.h>
26#include <qlineedit.h> 31#include <qlineedit.h>
27#include <qsizepolicy.h> 32#include <qsizepolicy.h>
28#include <qdatetime.h> 33#include <qdatetime.h>
29#include <qhbox.h> 34#include <qhbox.h>
30 35
31TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f) 36TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f)
32 : QWidget(parent, name, f) 37 : QWidget(parent, name, f)
33{ 38{
34 int stack_elem = 0; 39 int stack_elem = 0;
@@ -191,18 +196,17 @@ TVVariant TVFilterKeyEntry::getCompareValue()
191 break; 196 break;
192 } 197 }
193 case TVVariant::Time: { 198 case TVVariant::Time: {
194 sendkey = TVVariant(QTime(timeKey->time())); 199 sendkey = TVVariant(QTime(timeKey->time()));
195 break; 200 break;
196 } 201 }
197 case TVVariant::Date: { 202 case TVVariant::Date: {
198 sendkey = TVVariant(QDate(dateKey->date())); 203 sendkey = TVVariant(QDate(dateKey->date()));
199 break; 204 break;
200 } 205 }
201 default: { 206 default: {
202 sendkey = TVVariant(0); 207 sendkey = TVVariant(0);
203 qWarning("TVFilterKeyEntry::getCompareValue() " 208 owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl;
204 "cannot work out data type");
205 } 209 }
206 } 210 }
207 return sendkey; 211 return sendkey;
208} 212}
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp
index 22f1fb7..198c8b5 100644
--- a/noncore/apps/tableviewer/ui/tvfilterview.cpp
+++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp
@@ -9,33 +9,39 @@
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "tvfilterview.h" 20#include "tvfilterview.h"
21
22/* OPIE */
23#include <opie2/odebug.h>
24#include <qpe/qpeapplication.h>
25using namespace Opie::Core;
26
27/* QT */
21#include <qtoolbutton.h> 28#include <qtoolbutton.h>
22#include <qcombobox.h> 29#include <qcombobox.h>
23#include <qlistview.h> 30#include <qlistview.h>
24#include <qlayout.h> 31#include <qlayout.h>
25#include <qheader.h> 32#include <qheader.h>
26#include <qpushbutton.h> 33#include <qpushbutton.h>
27#include <qlabel.h> 34#include <qlabel.h>
28 35
29#include <qpe/qpeapplication.h>
30 36
31TVFilterView::TVFilterView(TableState *t, QWidget* parent, 37TVFilterView::TVFilterView(TableState *t, QWidget* parent,
32 const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) 38 const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl)
33{ 39{
34 if ( !name ) 40 if ( !name )
35 setName( "Filter View" ); 41 setName( "Filter View" );
36 42
37 QVBoxLayout *vlayout = new QVBoxLayout(this); 43 QVBoxLayout *vlayout = new QVBoxLayout(this);
38 44
39 display = new QListView(this, "display"); 45 display = new QListView(this, "display");
40 display->addColumn("Key"); 46 display->addColumn("Key");
41 display->addColumn("Constraint"); 47 display->addColumn("Constraint");
@@ -166,26 +172,25 @@ bool TVFilterView::passesFilter(DataElem *d) {
166 if (!d->contains(t->keyIndex, t->value)) 172 if (!d->contains(t->keyIndex, t->value))
167 return false; 173 return false;
168 break; 174 break;
169 case ct_startswith: 175 case ct_startswith:
170 if (!d->startsWith(t->keyIndex, t->value)) 176 if (!d->startsWith(t->keyIndex, t->value))
171 return false; 177 return false;
172 break; 178 break;
173 case ct_endswith: 179 case ct_endswith:
174 if (!d->endsWith(t->keyIndex, t->value)) 180 if (!d->endsWith(t->keyIndex, t->value))
175 return false; 181 return false;
176 break; 182 break;
177 default: 183 default:
178 qWarning("TVFilterView::passesFilter() " 184 owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl;
179 "unrecognized filter type");
180 return false; 185 return false;
181 } 186 }
182 } 187 }
183 return true; 188 return true;
184} 189}
185 190
186bool TVFilterView::filterActive() const 191bool TVFilterView::filterActive() const
187{ 192{
188 /* when button operated, also check the do_filter value 193 /* when button operated, also check the do_filter value
189 return do_filter; 194 return do_filter;
190 */ 195 */
191 if (terms.isEmpty()) 196 if (terms.isEmpty())
diff --git a/noncore/apps/tinykate/libkate/kateconfig.cpp b/noncore/apps/tinykate/libkate/kateconfig.cpp
index 782b629..4b8ce78 100644
--- a/noncore/apps/tinykate/libkate/kateconfig.cpp
+++ b/noncore/apps/tinykate/libkate/kateconfig.cpp
@@ -15,24 +15,25 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_LANGLIST 21#define QTOPIA_INTERNAL_LANGLIST
22#include "kateconfig.h" 22#include "kateconfig.h"
23 23
24/* OPIE */ 24/* OPIE */
25#include <opie2/odebug.h> 25#include <opie2/odebug.h>
26#include <qpe/global.h> 26#include <qpe/global.h>
27using namespace Opie::Core;
27 28
28/* QT */ 29/* QT */
29#include <qdir.h> 30#include <qdir.h>
30#include <qmessagebox.h> 31#include <qmessagebox.h>
31#if QT_VERSION <= 230 && defined(QT_NO_CODECS) 32#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
32#include <qtextcodec.h> 33#include <qtextcodec.h>
33#endif 34#endif
34#include <qtextstream.h> 35#include <qtextstream.h>
35 36
36/* STD */ 37/* STD */
37#include <sys/stat.h> 38#include <sys/stat.h>
38#include <sys/types.h> 39#include <sys/types.h>
@@ -547,26 +548,25 @@ void KateConfig::write( const QString &fn )
547 total_length = f.writeBlock( cstr.data(), cstr.length() ); 548 total_length = f.writeBlock( cstr.data(), cstr.length() );
548 if ( total_length != int(cstr.length()) ) { 549 if ( total_length != int(cstr.length()) ) {
549 QMessageBox::critical( 0, QObject::tr("Out of Space"), 550 QMessageBox::critical( 0, QObject::tr("Out of Space"),
550 QObject::tr("There was a problem creating\nKateConfiguration Information \nfor this program.\n\nPlease free up some space and\ntry again.") ); 551 QObject::tr("There was a problem creating\nKateConfiguration Information \nfor this program.\n\nPlease free up some space and\ntry again.") );
551 f.close(); 552 f.close();
552 QFile::remove( strNewFile ); 553 QFile::remove( strNewFile );
553 return; 554 return;
554 } 555 }
555 556
556 f.close(); 557 f.close();
557 // now rename the file... 558 // now rename the file...
558 if ( rename( strNewFile, filename ) < 0 ) { 559 if ( rename( strNewFile, filename ) < 0 ) {
559 qWarning( "problem renaming the file %s to %s", strNewFile.latin1(), 560 owarn << "problem renaming the file " << strNewFile.latin1() << " to " << filename.latin1() << oendl;
560 filename.latin1() );
561 QFile::remove( strNewFile ); 561 QFile::remove( strNewFile );
562 } 562 }
563} 563}
564 564
565/*! 565/*!
566 Returns whether the KateConfig is in a valid state. 566 Returns whether the KateConfig is in a valid state.
567*/ 567*/
568bool KateConfig::isValid() const 568bool KateConfig::isValid() const
569{ 569{
570 return groups.end() != git; 570 return groups.end() != git;
571} 571}
572 572
diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp
index 4fe319b..5f48f77 100644
--- a/noncore/apps/zsafe/main.cpp
+++ b/noncore/apps/zsafe/main.cpp
@@ -1,27 +1,35 @@
1/* 1/*
2** Author: Carsten Schneider <CarstenSchneider@t-online.de> 2** Author: Carsten Schneider <CarstenSchneider@t-online.de>
3** 3**
4** $Id$ 4** $Id$
5** 5**
6** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html 6** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html
7*/ 7*/
8 8
9 9
10#include "zsafe.h" 10#include "zsafe.h"
11
12/* OPIE */
13#include <opie2/odebug.h>
14using namespace Opie::Core;
15
16/* QT */
11#ifdef DESKTOP 17#ifdef DESKTOP
12#include <qapplication.h> 18#include <qapplication.h>
13#else 19#else
14#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
15#endif 21#endif
22
23/* STD */
16#include <stdio.h> 24#include <stdio.h>
17#include <signal.h> 25#include <signal.h>
18 26
19ZSafe *zs; 27ZSafe *zs;
20#ifdef DESKTOP 28#ifdef DESKTOP
21QApplication *appl; 29QApplication *appl;
22#else 30#else
23QPEApplication *appl; 31QPEApplication *appl;
24#endif 32#endif
25 33
26int DeskW; 34int DeskW;
27int DeskH; 35int DeskH;
@@ -65,37 +73,34 @@ int main( int argc, char ** argv )
65 DeskH = h; 73 DeskH = h;
66#endif 74#endif
67 } 75 }
68 else 76 else
69 { 77 {
70 DeskW = 600; 78 DeskW = 600;
71 DeskH = 400; 79 DeskH = 400;
72 } 80 }
73#else 81#else
74 DeskW = a.desktop()->width(); 82 DeskW = a.desktop()->width();
75 DeskH = a.desktop()->height(); 83 DeskH = a.desktop()->height();
76 84
77 char buf[128]; 85 owarn << "Width: " << DeskW << " Height: " << DeskH << oendl;
78 sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH);
79 qWarning (buf);
80 86
81#ifdef JPATCH_HDE 87#ifdef JPATCH_HDE
82 // nothings 88 // nothings
83#else 89#else
84 if (DeskW > 240) 90 if (DeskW > 240)
85 { 91 {
86 DeskW -= 20; 92 DeskW -= 20;
87 DeskH += 25; 93 DeskH += 25;
88 sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); 94 owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl;
89 qWarning (buf);
90 } 95 }
91#endif 96#endif
92 97
93#endif 98#endif
94 99
95 ZSafe mw; 100 ZSafe mw;
96 zs = &mw; 101 zs = &mw;
97 102
98#ifndef WIN32 103#ifndef WIN32
99 signal (SIGCONT, resume); 104 signal (SIGCONT, resume);
100#endif 105#endif
101#ifdef DESKTOP 106#ifdef DESKTOP
diff --git a/noncore/apps/zsafe/zlistview.cpp b/noncore/apps/zsafe/zlistview.cpp
index ba02a15..7d0b8c2 100644
--- a/noncore/apps/zsafe/zlistview.cpp
+++ b/noncore/apps/zsafe/zlistview.cpp
@@ -1,35 +1,38 @@
1/* 1/*
2** $Id$ 2** $Id$
3*/ 3*/
4 4
5#include "zlistview.h" 5#include "zlistview.h"
6#include <stdio.h>
7#include "zsafe.h" 6#include "zsafe.h"
8 7
8/* OPIE */
9//#include <opie2/odebug.h>
10
11/* STD */
12#include <stdio.h>
13
9ZListView::ZListView (ZSafe *zsafe, const char *id) : QListView(zsafe, id) 14ZListView::ZListView (ZSafe *zsafe, const char *id) : QListView(zsafe, id)
10{ 15{
11 zs = zsafe; 16 zs = zsafe;
12} 17}
13 18
14ZListView::~ZListView() 19ZListView::~ZListView()
15{ 20{
16} 21}
17 22
18void ZListView::keyPressEvent ( QKeyEvent *e ) 23void ZListView::keyPressEvent ( QKeyEvent *e )
19{ 24{
20/* 25/*
21 char buf[64]; 26 owarn << "key: " << e->key() << oendl;
22 sprintf (buf, "key: %d\n", e->key());
23 qWarning (buf);
24*/ 27*/
25 28
26 switch (e->key()) 29 switch (e->key())
27 { 30 {
28 case 32: // middle cursor key pressed 31 case 32: // middle cursor key pressed
29 zs->showInfo (zs->selectedItem); 32 zs->showInfo (zs->selectedItem);
30 break; 33 break;
31 default: 34 default:
32 QListView::keyPressEvent( e ); 35 QListView::keyPressEvent( e );
33 } 36 }
34 37
35} 38}
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 6ff05ac..ca3ff52 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -872,25 +872,25 @@ void ZSafe::findPwd()
872#ifdef DESKTOP 872#ifdef DESKTOP
873 result = Accepted; 873 result = Accepted;
874#endif 874#endif
875 875
876 QString name; 876 QString name;
877 QString username; 877 QString username;
878 QString comment; 878 QString comment;
879 if (result == Accepted) 879 if (result == Accepted)
880 { 880 {
881 name = dialog->NameField->text(); 881 name = dialog->NameField->text();
882 username = dialog->UsernameField->text(); 882 username = dialog->UsernameField->text();
883 comment = dialog->CommentField->text(); 883 comment = dialog->CommentField->text();
884 qWarning (name); 884 owarn << name << oendl;
885 } 885 }
886 else 886 else
887 { 887 {
888 delete dialog; 888 delete dialog;
889 return; 889 return;
890 } 890 }
891 891
892 if (!name.isEmpty() && name != lastSearchedName || 892 if (!name.isEmpty() && name != lastSearchedName ||
893 lastSearchedName.isEmpty() && !name.isEmpty()) 893 lastSearchedName.isEmpty() && !name.isEmpty())
894 { 894 {
895 // set search at the beginning if a new name is given 895 // set search at the beginning if a new name is given
896 lastSearchedCategory = NULL; 896 lastSearchedCategory = NULL;
@@ -918,56 +918,56 @@ void ZSafe::findPwd()
918 918
919 bool found=FALSE; 919 bool found=FALSE;
920 // step through all categories 920 // step through all categories
921 QListViewItem *i; 921 QListViewItem *i;
922 if (lastSearchedCategory) 922 if (lastSearchedCategory)
923 i = lastSearchedCategory; 923 i = lastSearchedCategory;
924 else 924 else
925 i = ListView->firstChild(); 925 i = ListView->firstChild();
926 for (; 926 for (;
927 i != NULL; 927 i != NULL;
928 i = i->nextSibling()) 928 i = i->nextSibling())
929 { 929 {
930 qWarning (i->text(0)); 930 owarn << i->text(0) << oendl;
931 i->setSelected(FALSE); 931 i->setSelected(FALSE);
932 932
933 // step through all subitems 933 // step through all subitems
934 QListViewItem *si; 934 QListViewItem *si;
935 if (lastSearchedItem) 935 if (lastSearchedItem)
936 si = lastSearchedItem; 936 si = lastSearchedItem;
937 else 937 else
938 si = i->firstChild(); 938 si = i->firstChild();
939 // for (si = i->firstChild(); 939 // for (si = i->firstChild();
940 for (; 940 for (;
941 si != NULL; 941 si != NULL;
942 si = si->nextSibling()) 942 si = si->nextSibling())
943 { 943 {
944 qWarning (si->text(0)); 944 owarn << si->text(0) << oendl;
945 if (si->isSelected()) 945 if (si->isSelected())
946 si->setSelected(FALSE); 946 si->setSelected(FALSE);
947 // ListView->repaintItem(si); 947 // ListView->repaintItem(si);
948 948
949 bool n=TRUE; 949 bool n=TRUE;
950 bool u=TRUE; 950 bool u=TRUE;
951 bool c=TRUE; 951 bool c=TRUE;
952 if (!name.isEmpty()) 952 if (!name.isEmpty())
953 n = (si->text(0)).contains (name, FALSE); 953 n = (si->text(0)).contains (name, FALSE);
954 if (!username.isEmpty()) 954 if (!username.isEmpty())
955 u = (si->text(1)).contains (username, FALSE); 955 u = (si->text(1)).contains (username, FALSE);
956 if (!comment.isEmpty()) 956 if (!comment.isEmpty())
957 c = (si->text(3)).contains (comment, FALSE); 957 c = (si->text(3)).contains (comment, FALSE);
958 958
959 if ((n && u && c ) && !found) 959 if ((n && u && c ) && !found)
960 { 960 {
961 qWarning ("Found"); 961 owarn << "Found" << oendl;
962 selectedItem = si; 962 selectedItem = si;
963 si->setSelected(TRUE); 963 si->setSelected(TRUE);
964 ListView->setCurrentItem(si); 964 ListView->setCurrentItem(si);
965 ListView->ensureItemVisible(si); 965 ListView->ensureItemVisible(si);
966 ListView->triggerUpdate(); 966 ListView->triggerUpdate();
967 967
968 lastSearchedCategory = i; 968 lastSearchedCategory = i;
969 // set to the next item 969 // set to the next item
970 lastSearchedItem = si->nextSibling(); 970 lastSearchedItem = si->nextSibling();
971 if (!lastSearchedItem) 971 if (!lastSearchedItem)
972 { 972 {
973 // no next item within category -> set next category 973 // no next item within category -> set next category
@@ -1219,26 +1219,25 @@ void ZSafe::removeAsciiFile()
1219 QDir::homeDirPath() + "/Documents/application/zsafe", 1219 QDir::homeDirPath() + "/Documents/application/zsafe",
1220 "ZSafe (*.txt)", 1220 "ZSafe (*.txt)",
1221 this, 1221 this,
1222 "ZSafe File Dialog" 1222 "ZSafe File Dialog"
1223 "Choose a text file" ); 1223 "Choose a text file" );
1224#endif 1224#endif
1225 1225
1226 if (fn && fn.length() > 0 ) 1226 if (fn && fn.length() > 0 )
1227 { 1227 {
1228 QFile f( fn ); 1228 QFile f( fn );
1229 if ( !f.remove() ) 1229 if ( !f.remove() )
1230 { 1230 {
1231 qWarning( QString("Could not remove file %1").arg(fn), 1231 owarn << "Could not remove file " << fn << oendl;
1232 2000 );
1233 QMessageBox::critical( 0, tr("ZSafe"), 1232 QMessageBox::critical( 0, tr("ZSafe"),
1234 tr("Could not remove text file.") ); 1233 tr("Could not remove text file.") );
1235 return; 1234 return;
1236 } 1235 }
1237 } 1236 }
1238} 1237}
1239 1238
1240void ZSafe::writeAllEntries() 1239void ZSafe::writeAllEntries()
1241{ 1240{
1242 if (filename.isEmpty()) 1241 if (filename.isEmpty())
1243 { 1242 {
1244 QMessageBox::critical( 0, tr("ZSafe"), 1243 QMessageBox::critical( 0, tr("ZSafe"),
@@ -1269,26 +1268,25 @@ void ZSafe::writeAllEntries()
1269 QDir::homeDirPath() + "/Documents/application/zsafe", 1268 QDir::homeDirPath() + "/Documents/application/zsafe",
1270 "ZSafe (*.txt)", 1269 "ZSafe (*.txt)",
1271 this, 1270 this,
1272 "ZSafe File Dialog" 1271 "ZSafe File Dialog"
1273 "Choose a text file" ); 1272 "Choose a text file" );
1274#endif 1273#endif
1275 1274
1276 // open the new document 1275 // open the new document
1277 if (fn && fn.length() > 0 ) 1276 if (fn && fn.length() > 0 )
1278 { 1277 {
1279 QFile f( fn ); 1278 QFile f( fn );
1280 if ( !f.open( IO_WriteOnly ) ) { 1279 if ( !f.open( IO_WriteOnly ) ) {
1281 qWarning( QString("Could not write to file %1").arg(fn), 1280 owarn << "Could not write to file " << fn << oendl;
1282 2000 );
1283 QMessageBox::critical( 0, "ZSafe", 1281 QMessageBox::critical( 0, "ZSafe",
1284 QString("Could not export to text file.") ); 1282 QString("Could not export to text file.") );
1285 return; 1283 return;
1286 } 1284 }
1287 QTextStream t( &f ); 1285 QTextStream t( &f );
1288 1286
1289 QListViewItem *i; 1287 QListViewItem *i;
1290 // step through all categories 1288 // step through all categories
1291 for (i = ListView->firstChild(); 1289 for (i = ListView->firstChild();
1292 i != NULL; 1290 i != NULL;
1293 i = i->nextSibling()) 1291 i = i->nextSibling())
1294 { 1292 {
@@ -1313,28 +1311,28 @@ void ZSafe::writeAllEntries()
1313 oneEntry += "\";"; 1311 oneEntry += "\";";
1314 oneEntry += "\""; 1312 oneEntry += "\"";
1315 QString comment = si->text(3); 1313 QString comment = si->text(3);
1316 comment.replace (QRegExp("\n"), "<br>"); 1314 comment.replace (QRegExp("\n"), "<br>");
1317 oneEntry += comment; 1315 oneEntry += comment;
1318 oneEntry += "\";"; 1316 oneEntry += "\";";
1319 oneEntry += "\""; 1317 oneEntry += "\"";
1320 oneEntry += si->text(4); 1318 oneEntry += si->text(4);
1321 oneEntry += "\";"; 1319 oneEntry += "\";";
1322 oneEntry += "\""; 1320 oneEntry += "\"";
1323 oneEntry += si->text(5); 1321 oneEntry += si->text(5);
1324 oneEntry += "\""; 1322 oneEntry += "\"";
1325 // qWarning (oneEntry); 1323 // owarn << oneEntry << oendl;
1326 t << oneEntry << endl; 1324 t << oneEntry << endl;
1327 1325
1328 // qWarning (si->text(0)); 1326 // owarn << si->text(0) << oendl;
1329 } 1327 }
1330 } 1328 }
1331 f.close(); 1329 f.close();
1332 } 1330 }
1333} 1331}
1334 1332
1335void ZSafe::readAllEntries() 1333void ZSafe::readAllEntries()
1336{ 1334{
1337 if (filename.isEmpty()) 1335 if (filename.isEmpty())
1338 { 1336 {
1339 QMessageBox::critical( 0, tr("ZSafe"), 1337 QMessageBox::critical( 0, tr("ZSafe"),
1340 tr("No document defined.\nYou have to create a new document")); 1338 tr("No document defined.\nYou have to create a new document"));
@@ -1364,26 +1362,25 @@ void ZSafe::readAllEntries()
1364 QDir::homeDirPath() + "/Documents/application/zsafe", 1362 QDir::homeDirPath() + "/Documents/application/zsafe",
1365 "ZSafe (*.txt)", 1363 "ZSafe (*.txt)",
1366 this, 1364 this,
1367 "ZSafe File Dialog" 1365 "ZSafe File Dialog"
1368 "Choose a text file" ); 1366 "Choose a text file" );
1369#endif 1367#endif
1370 1368
1371 if (fn && fn.length() > 0 ) 1369 if (fn && fn.length() > 0 )
1372 { 1370 {
1373 QFile f( fn ); 1371 QFile f( fn );
1374 if ( !f.open( IO_ReadOnly ) ) 1372 if ( !f.open( IO_ReadOnly ) )
1375 { 1373 {
1376 qWarning( QString("Could not read file %1").arg(fn), 1374 owarn << "Could not read file " << fn << oendl;
1377 2000 );
1378 QMessageBox::critical( 0, "ZSafe", 1375 QMessageBox::critical( 0, "ZSafe",
1379 QString("Could not import text file.") ); 1376 QString("Could not import text file.") );
1380 return; 1377 return;
1381 } 1378 }
1382 1379
1383 modified = true; 1380 modified = true;
1384 1381
1385 // clear the password list 1382 // clear the password list
1386 selectedItem = NULL; 1383 selectedItem = NULL;
1387 QListViewItem *i; 1384 QListViewItem *i;
1388 // step through all categories 1385 // step through all categories
1389 for (i = ListView->firstChild(); 1386 for (i = ListView->firstChild();
@@ -1394,25 +1391,25 @@ void ZSafe::readAllEntries()
1394 QListViewItem *si; 1391 QListViewItem *si;
1395 for (si = i->firstChild(); 1392 for (si = i->firstChild();
1396 si != NULL; ) 1393 si != NULL; )
1397 // si = si->nextSibling()) 1394 // si = si->nextSibling())
1398 { 1395 {
1399 QListViewItem *_si = si; 1396 QListViewItem *_si = si;
1400 si = si->nextSibling(); 1397 si = si->nextSibling();
1401 i->takeItem(_si); // remove from view list 1398 i->takeItem(_si); // remove from view list
1402 if (_si) delete _si; 1399 if (_si) delete _si;
1403 } 1400 }
1404 } 1401 }
1405 1402
1406 qWarning ("ReadAllEntries(): "); 1403 owarn << "ReadAllEntries(): " << oendl;
1407 1404
1408 QTextStream t(&f); 1405 QTextStream t(&f);
1409 while ( !t.eof() ) 1406 while ( !t.eof() )
1410 { 1407 {
1411 QString s = t.readLine(); 1408 QString s = t.readLine();
1412 s.replace (QRegExp("\";\""), "\"|\""); 1409 s.replace (QRegExp("\";\""), "\"|\"");
1413 // char buffer[1024]; 1410 // char buffer[1024];
1414#ifndef WIN32 1411#ifndef WIN32
1415 char buffer[s.length()+1]; 1412 char buffer[s.length()+1];
1416#else 1413#else
1417 char buffer[4048]; 1414 char buffer[4048];
1418#endif 1415#endif
@@ -1545,26 +1542,25 @@ void ZSafe::readAllEntries()
1545 { 1542 {
1546 } 1543 }
1547 1544
1548} 1545}
1549 1546
1550#ifdef UNUSED 1547#ifdef UNUSED
1551void ZSafe::writeAllEntries() 1548void ZSafe::writeAllEntries()
1552{ 1549{
1553 // open the file for writing 1550 // open the file for writing
1554 QString fn = filename + ".txt"; 1551 QString fn = filename + ".txt";
1555 QFile f( fn ); 1552 QFile f( fn );
1556 if ( !f.open( IO_WriteOnly ) ) { 1553 if ( !f.open( IO_WriteOnly ) ) {
1557 qWarning( QString("Could not write to file %1").arg(fn), 1554 owarn << "Could not write to file " << fn << oendl;
1558 2000 );
1559 QMessageBox::critical( 0, tr("ZSafe"), 1555 QMessageBox::critical( 0, tr("ZSafe"),
1560 tr("Could not export to text file.") ); 1556 tr("Could not export to text file.") );
1561 return; 1557 return;
1562 } 1558 }
1563 QTextStream t( &f ); 1559 QTextStream t( &f );
1564 1560
1565 QListViewItem *i; 1561 QListViewItem *i;
1566 // step through all categories 1562 // step through all categories
1567 for (i = ListView->firstChild(); 1563 for (i = ListView->firstChild();
1568 i != NULL; 1564 i != NULL;
1569 i = i->nextSibling()) 1565 i = i->nextSibling())
1570 { 1566 {
@@ -1584,41 +1580,40 @@ void ZSafe::writeAllEntries()
1584 oneEntry += "\""; 1580 oneEntry += "\"";
1585 oneEntry += si->text(1); 1581 oneEntry += si->text(1);
1586 oneEntry += "\";"; 1582 oneEntry += "\";";
1587 oneEntry += "\""; 1583 oneEntry += "\"";
1588 oneEntry += si->text(2); 1584 oneEntry += si->text(2);
1589 oneEntry += "\";"; 1585 oneEntry += "\";";
1590 oneEntry += "\""; 1586 oneEntry += "\"";
1591 // oneEntry += si->text(3); 1587 // oneEntry += si->text(3);
1592 QString comment = si->text(3); 1588 QString comment = si->text(3);
1593 comment.replace (QRegExp("\n"), "<br>"); 1589 comment.replace (QRegExp("\n"), "<br>");
1594 oneEntry += comment; 1590 oneEntry += comment;
1595 oneEntry += "\""; 1591 oneEntry += "\"";
1596 // qWarning (oneEntry); 1592 // owarn << oneEntry << oendl;
1597 t << oneEntry << endl; 1593 t << oneEntry << endl;
1598 1594
1599 // qWarning (si->text(0)); 1595 // owarn << si->text(0) << oendl;
1600 } 1596 }
1601 } 1597 }
1602 f.close(); 1598 f.close();
1603} 1599}
1604 1600
1605void ZSafe::readAllEntries() 1601void ZSafe::readAllEntries()
1606{ 1602{
1607 QString fn = filename + ".txt"; 1603 QString fn = filename + ".txt";
1608 QFile f( fn ); 1604 QFile f( fn );
1609 if ( !f.open( IO_ReadOnly ) ) 1605 if ( !f.open( IO_ReadOnly ) )
1610 { 1606 {
1611 qWarning( QString("Could not read file %1").arg(fn), 1607 owarn << "Could not read file " << fn << oendl;
1612 2000 );
1613 QMessageBox::critical( 0, tr("ZSafe"), 1608 QMessageBox::critical( 0, tr("ZSafe"),
1614 tr("Could not import text file.") ); 1609 tr("Could not import text file.") );
1615 return; 1610 return;
1616 } 1611 }
1617 1612
1618 modified = true; 1613 modified = true;
1619 1614
1620 // clear the password list 1615 // clear the password list
1621 selectedItem = NULL; 1616 selectedItem = NULL;
1622 QListViewItem *i; 1617 QListViewItem *i;
1623 // step through all categories 1618 // step through all categories
1624 for (i = ListView->firstChild(); 1619 for (i = ListView->firstChild();
@@ -1629,25 +1624,25 @@ void ZSafe::readAllEntries()
1629 QListViewItem *si; 1624 QListViewItem *si;
1630 for (si = i->firstChild(); 1625 for (si = i->firstChild();
1631 si != NULL; ) 1626 si != NULL; )
1632 // si = si->nextSibling()) 1627 // si = si->nextSibling())
1633 { 1628 {
1634 QListViewItem *_si = si; 1629 QListViewItem *_si = si;
1635 si = si->nextSibling(); 1630 si = si->nextSibling();
1636 i->takeItem(_si); // remove from view list 1631 i->takeItem(_si); // remove from view list
1637 if (_si) delete _si; 1632 if (_si) delete _si;
1638 } 1633 }
1639 } 1634 }
1640 1635
1641 qWarning ("ReadAllEntries(): "); 1636 owarn << "ReadAllEntries(): " << oendl;
1642 1637
1643 QTextStream t(&f); 1638 QTextStream t(&f);
1644 while ( !t.eof() ) 1639 while ( !t.eof() )
1645 { 1640 {
1646 QString s = t.readLine(); 1641 QString s = t.readLine();
1647 s.replace (QRegExp("\";\""), "\"|\""); 1642 s.replace (QRegExp("\";\""), "\"|\"");
1648 // char buffer[1024]; 1643 // char buffer[1024];
1649 int len=s.length()+1; 1644 int len=s.length()+1;
1650#ifdef WIN32 1645#ifdef WIN32
1651 char buffer[512]; 1646 char buffer[512];
1652#else 1647#else
1653 char buffer[len]; 1648 char buffer[len];
@@ -1753,25 +1748,25 @@ void ZSafe::readAllEntries()
1753 c1->initListItem(); 1748 c1->initListItem();
1754 categories.insert (c1->getCategoryName(), c1); 1749 categories.insert (c1->getCategoryName(), c1);
1755 } 1750 }
1756 1751
1757 } 1752 }
1758 f.close(); 1753 f.close();
1759 1754
1760} 1755}
1761#endif // UNUSED 1756#endif // UNUSED
1762 1757
1763void ZSafe::resume(int) 1758void ZSafe::resume(int)
1764{ 1759{
1765 qWarning ("Resume"); 1760 owarn << "Resume" << oendl;
1766 // hide the main window 1761 // hide the main window
1767 1762
1768 infoForm->hide(); 1763 infoForm->hide();
1769 // open zsafe again 1764 // open zsafe again
1770 m_password = ""; 1765 m_password = "";
1771 selectedItem = NULL; 1766 selectedItem = NULL;
1772 1767
1773 // clear the password list 1768 // clear the password list
1774 QListViewItem *i; 1769 QListViewItem *i;
1775 // step through all categories 1770 // step through all categories
1776 for (i = ListView->firstChild(); 1771 for (i = ListView->firstChild();
1777 i != NULL; 1772 i != NULL;
@@ -1809,34 +1804,34 @@ bool ZSafe::openDocument(const char* _filename, const char* )
1809 int pwdOk = 0; 1804 int pwdOk = 0;
1810 int numberOfTries = 3; 1805 int numberOfTries = 3;
1811 for (int i=0; i < numberOfTries; i++) 1806 for (int i=0; i < numberOfTries; i++)
1812 { 1807 {
1813 QFile f(_filename); 1808 QFile f(_filename);
1814 if (f.exists()) 1809 if (f.exists())
1815 { 1810 {
1816 // ask with a dialog for the password 1811 // ask with a dialog for the password
1817 if (m_password.isEmpty()) 1812 if (m_password.isEmpty())
1818 getDocPassword(tr("Enter Password")); 1813 getDocPassword(tr("Enter Password"));
1819 if (m_password.isEmpty() && validationFlag == 0) 1814 if (m_password.isEmpty() && validationFlag == 0)
1820 { 1815 {
1821 qWarning ("Wrong password"); 1816 owarn << "Wrong password" << oendl;
1822 QMessageBox::critical( 0, tr("ZSafe"), 1817 QMessageBox::critical( 0, tr("ZSafe"),
1823 tr("Wrong password.\n\nZSafe will now exit.") ); 1818 tr("Wrong password.\n\nZSafe will now exit.") );
1824 exitZs (1); 1819 exitZs (1);
1825 } 1820 }
1826 1821
1827 retval = loadInit(_filename, m_password); 1822 retval = loadInit(_filename, m_password);
1828 if (retval != PWERR_GOOD) 1823 if (retval != PWERR_GOOD)
1829 { 1824 {
1830 qWarning ("Error loading Document"); 1825 owarn << "Error loading Document" << oendl;
1831 return false; 1826 return false;
1832 } 1827 }
1833 } 1828 }
1834 else 1829 else
1835 { 1830 {
1836#ifdef WIN32 1831#ifdef WIN32
1837 this->setCaption("Qt ZSafe"); 1832 this->setCaption("Qt ZSafe");
1838#else 1833#else
1839 this->setCaption("ZSafe"); 1834 this->setCaption("ZSafe");
1840#endif 1835#endif
1841 filename = ""; 1836 filename = "";
1842 return false; 1837 return false;
@@ -2292,25 +2287,25 @@ bool ZSafe::saveDocument(const char* _filename,
2292} 2287}
2293 2288
2294PasswordForm *newPwdDialog; 2289PasswordForm *newPwdDialog;
2295bool newPwdDialogResult = false; 2290bool newPwdDialogResult = false;
2296void ZSafe::setPasswordDialogDone() 2291void ZSafe::setPasswordDialogDone()
2297{ 2292{
2298 newPwdDialogResult = true; 2293 newPwdDialogResult = true;
2299 newPwdDialog->close(); 2294 newPwdDialog->close();
2300} 2295}
2301 2296
2302void ZSafe::getDocPassword(QString title) 2297void ZSafe::getDocPassword(QString title)
2303{ 2298{
2304qWarning ("getDocPassword"); 2299 owarn << "getDocPassword" << oendl;
2305 // open the 'Password' dialog 2300 // open the 'Password' dialog
2306 PasswordForm *dialog = new PasswordForm(this, title, TRUE); 2301 PasswordForm *dialog = new PasswordForm(this, title, TRUE);
2307 newPwdDialog = dialog; 2302 newPwdDialog = dialog;
2308 newPwdDialogResult = false; 2303 newPwdDialogResult = false;
2309 2304
2310 connect( dialog->PasswordField, SIGNAL( returnPressed() ), 2305 connect( dialog->PasswordField, SIGNAL( returnPressed() ),
2311 this, SLOT( setPasswordDialogDone() ) ); 2306 this, SLOT( setPasswordDialogDone() ) );
2312 2307
2313 // CS: !!! 2308 // CS: !!!
2314 // int pos = filename.findRev ('/'); 2309 // int pos = filename.findRev ('/');
2315 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1); 2310 QString ti = filename.right (filename.length() - filename.findRev ('/') - 1);
2316#ifdef WIN32 2311#ifdef WIN32
@@ -2471,25 +2466,25 @@ int ZSafe::saveFinalize(void)
2471 ciphertext[count1] = iv[count1] ^ plaintext[count1]; 2466 ciphertext[count1] = iv[count1] ^ plaintext[count1];
2472 if (putc ((unsigned char) (ciphertext[count1] >> 8), fd) == EOF) retval = PWERR_DATA; 2467 if (putc ((unsigned char) (ciphertext[count1] >> 8), fd) == EOF) retval = PWERR_DATA;
2473 if (putc ((unsigned char) (ciphertext[count1] & 0xff), fd) == EOF) retval = PWERR_DATA; 2468 if (putc ((unsigned char) (ciphertext[count1] & 0xff), fd) == EOF) retval = PWERR_DATA;
2474 } 2469 }
2475 2470
2476 fclose (fd); 2471 fclose (fd);
2477 free(buffer); 2472 free(buffer);
2478 return retval; 2473 return retval;
2479} 2474}
2480 2475
2481void ZSafe::quitMe () 2476void ZSafe::quitMe ()
2482{ 2477{
2483 qWarning ("QUIT..."); 2478 owarn << "QUIT..." << oendl;
2484 2479
2485 if (modified) 2480 if (modified)
2486 { 2481 {
2487 switch( QMessageBox::information( this, tr("ZSafe"), 2482 switch( QMessageBox::information( this, tr("ZSafe"),
2488 tr("Do you want to save\nbefore exiting?"), 2483 tr("Do you want to save\nbefore exiting?"),
2489 tr("&Save"), 2484 tr("&Save"),
2490 tr("S&ave with\nnew\npassword"), 2485 tr("S&ave with\nnew\npassword"),
2491 tr("&Don't Save"), 2486 tr("&Don't Save"),
2492 0 // Enter == button 0 2487 0 // Enter == button 0
2493 ) ) 2488 ) )
2494 { // Escape == button 2 2489 { // Escape == button 2
2495 case 0: // Save clicked, Alt-S or Enter pressed. 2490 case 0: // Save clicked, Alt-S or Enter pressed.
@@ -2675,25 +2670,25 @@ void ZSafe::addCategory()
2675#endif 2670#endif
2676 2671
2677 QString category; 2672 QString category;
2678 QString icon; 2673 QString icon;
2679 QString fullIconPath; 2674 QString fullIconPath;
2680 QPixmap *pix; 2675 QPixmap *pix;
2681 if (result == Accepted) 2676 if (result == Accepted)
2682 { 2677 {
2683 modified = true; 2678 modified = true;
2684 category = dialog->CategoryField->currentText(); 2679 category = dialog->CategoryField->currentText();
2685 icon = dialog->IconField->currentText()+".png"; 2680 icon = dialog->IconField->currentText()+".png";
2686 2681
2687 qWarning (category); 2682 owarn << category << oendl;
2688 2683
2689 QListViewItem *li = new ShadedListItem( 1, ListView ); 2684 QListViewItem *li = new ShadedListItem( 1, ListView );
2690 Category *c1 = new Category(); 2685 Category *c1 = new Category();
2691 c1->setCategoryName(category); 2686 c1->setCategoryName(category);
2692 2687
2693 // if (!icon.isEmpty() && !icon.isNull()) 2688 // if (!icon.isEmpty() && !icon.isNull())
2694 if (icon != "predefined.png") 2689 if (icon != "predefined.png")
2695 { 2690 {
2696 // build the full path 2691 // build the full path
2697 fullIconPath = iconPath + icon; 2692 fullIconPath = iconPath + icon;
2698 pix = new QPixmap (fullIconPath); 2693 pix = new QPixmap (fullIconPath);
2699 // pix->resize(14, 14); 2694 // pix->resize(14, 14);
@@ -3183,25 +3178,25 @@ void ZSafe::editCategory()
3183 { 3178 {
3184// #ifndef WIN32 3179// #ifndef WIN32
3185 conf->removeEntry (category); 3180 conf->removeEntry (category);
3186// #endif 3181// #endif
3187 saveConf(); 3182 saveConf();
3188 cat->setIcon (*getPredefinedIcon(category)); 3183 cat->setIcon (*getPredefinedIcon(category));
3189 } 3184 }
3190 3185
3191 // change the category name of the selected category 3186 // change the category name of the selected category
3192 QListViewItem *catItem = cat->getListItem(); 3187 QListViewItem *catItem = cat->getListItem();
3193 if (catItem) 3188 if (catItem)
3194 { 3189 {
3195 qWarning (category); 3190 owarn << category << oendl;
3196 catItem->setText( 0, tr( category ) ); 3191 catItem->setText( 0, tr( category ) );
3197 cat->setCategoryName (tr(category)); 3192 cat->setCategoryName (tr(category));
3198 3193
3199 cat->initListItem(); 3194 cat->initListItem();
3200 categories.insert (category, cat); 3195 categories.insert (category, cat);
3201 } 3196 }
3202 } 3197 }
3203 saveCategoryDialogFields(dialog); 3198 saveCategoryDialogFields(dialog);
3204 } 3199 }
3205 else 3200 else
3206 { 3201 {
3207 // delete dialog; 3202 // delete dialog;
@@ -3584,25 +3579,25 @@ void ZSafe::paintEvent( QPaintEvent * )
3584{ 3579{
3585 if (raiseFlag) 3580 if (raiseFlag)
3586 { 3581 {
3587 raiseFlag = false; 3582 raiseFlag = false;
3588 raiseTimer.start (1, true); 3583 raiseTimer.start (1, true);
3589 if (infoForm->isVisible()) 3584 if (infoForm->isVisible())
3590 infoForm->raise(); 3585 infoForm->raise();
3591 } 3586 }
3592} 3587}
3593 3588
3594void ZSafe::resizeEvent ( QResizeEvent * ) 3589void ZSafe::resizeEvent ( QResizeEvent * )
3595{ 3590{
3596 // qWarning ("resizeEvent"); 3591 // owarn << "resizeEvent" << oendl;
3597#ifndef DESKTOP 3592#ifndef DESKTOP
3598 DeskW = appl->desktop()->width(); 3593 DeskW = appl->desktop()->width();
3599 DeskH = appl->desktop()->height(); 3594 DeskH = appl->desktop()->height();
3600#else 3595#else
3601 DeskW = this->width(); 3596 DeskW = this->width();
3602 DeskH = this->height(); 3597 DeskH = this->height();
3603#endif 3598#endif
3604 3599
3605 if (New) 3600 if (New)
3606 New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) ); 3601 New->setGeometry ( QRect( DeskW-84, 2, 20, 20 ) );
3607 if (Edit) 3602 if (Edit)
3608 Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) ); 3603 Edit->setGeometry ( QRect( DeskW-64, 2, 20, 20 ) );
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index d61433f..837fcc5 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -178,30 +178,29 @@ void KRFBDecoder::gotServerInit()
178 info->blueMax = Swap16IfLE( info->blueMax ); 178 info->blueMax = Swap16IfLE( info->blueMax );
179 179
180 con->read( &(info->redShift), 1 ); 180 con->read( &(info->redShift), 1 );
181 con->read( &(info->greenShift), 1 ); 181 con->read( &(info->greenShift), 1 );
182 con->read( &(info->blueShift), 1 ); 182 con->read( &(info->blueShift), 1 );
183 183
184 con->read( info->padding, 3 ); 184 con->read( info->padding, 3 );
185 185
186 con->read( &(info->nameLength), 4 ); 186 con->read( &(info->nameLength), 4 );
187 info->nameLength = Swap32IfLE( info->nameLength ); 187 info->nameLength = Swap32IfLE( info->nameLength );
188 188
189 owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl; 189 owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl;
190 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", 190 owarn << "Bpp = " << info->bpp << ", Depth = " << info->depth << ", Big = " << info->bigEndian
191 info->bpp, info->depth, info->bigEndian, info->trueColor ); 191 << ", True = " << info->trueColor << oendl;
192 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", 192 owarn << "RedMax = " << info->redMax << ", GreenMax = " << info->greenMax << ", BlueMax = " << info->blueMax << oendl;
193 info->redMax, info->greenMax, info->blueMax ); 193 owarn << "RedShift = " << info->redShift << ", GreenShift = " << info->greenShift
194 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", 194 << ", BlueShift = " << info-> blueShift << oendl;
195 info->redShift, info->greenShift,info-> blueShift );
196 195
197 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); 196 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor);
198 197
199 // Wait for desktop name 198 // Wait for desktop name
200 owarn << "Waiting for desktop name" << oendl; 199 owarn << "Waiting for desktop name" << oendl;
201 200
202 static QString statusMsg = tr( "Waiting for desktop name..." ); 201 static QString statusMsg = tr( "Waiting for desktop name..." );
203 emit status( statusMsg ); 202 emit status( statusMsg );
204 203
205 currentState = AwaitingDesktopName; 204 currentState = AwaitingDesktopName;
206 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); 205 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) );
207 con->waitForData( info->nameLength ); 206 con->waitForData( info->nameLength );
@@ -255,30 +254,27 @@ void KRFBDecoder::decidePixelFormat()
255 // 254 //
256 // We'll use the minimum of the remote and local depths, UNLESS an 255 // We'll use the minimum of the remote and local depths, UNLESS an
257 // eight bit session has been specifically requested by the user. 256 // eight bit session has been specifically requested by the user.
258 int screenDepth = QPixmap::defaultDepth(); 257 int screenDepth = QPixmap::defaultDepth();
259 int bestDepth = ( screenDepth > info->depth ) ? info->depth : screenDepth; 258 int bestDepth = ( screenDepth > info->depth ) ? info->depth : screenDepth;
260 int chosenDepth; 259 int chosenDepth;
261 260
262 if ( con->options()->colors256 ) 261 if ( con->options()->colors256 )
263 chosenDepth = 8; 262 chosenDepth = 8;
264 else 263 else
265 chosenDepth = bestDepth; 264 chosenDepth = bestDepth;
266 265
267 qWarning( "Screen depth=%d, server depth=%d, best depth=%d, " \ 266 owarn << "Screen depth=" << screenDepth << ", server depth=" << info->depth
268 "eight bit %d, chosenDepth=%d", 267 << ", best depth=" << bestDepth << "eight bit " << con->options()->colors256
269 screenDepth, 268 << ", chosenDepth=" << chosenDepth << oendl;
270 info->depth,
271 bestDepth,
272 con->options()->colors256, chosenDepth );
273 269
274 format->depth = chosenDepth; 270 format->depth = chosenDepth;
275 271
276 // If we're using the servers native depth 272 // If we're using the servers native depth
277 if ( chosenDepth == info->depth ) { 273 if ( chosenDepth == info->depth ) {
278 // Use the servers native format 274 // Use the servers native format
279 format->bpp = info->bpp; 275 format->bpp = info->bpp;
280 // format->bigEndian = info->bigEndian; 276 // format->bigEndian = info->bigEndian;
281 format->bigEndian = true; 277 format->bigEndian = true;
282 format->trueColor = info->trueColor; 278 format->trueColor = info->trueColor;
283 format->redMax = info->redMax; 279 format->redMax = info->redMax;
284 format->greenMax = info->greenMax; 280 format->greenMax = info->greenMax;
@@ -432,26 +428,26 @@ void KRFBDecoder::gotRectHeader()
432 x = Swap16IfLE( x ); 428 x = Swap16IfLE( x );
433 con->read( &y, 2 ); 429 con->read( &y, 2 );
434 y = Swap16IfLE( y ); 430 y = Swap16IfLE( y );
435 431
436 con->read( &w, 2 ); 432 con->read( &w, 2 );
437 w = Swap16IfLE( w ); 433 w = Swap16IfLE( w );
438 con->read( &h, 2 ); 434 con->read( &h, 2 );
439 h = Swap16IfLE( h ); 435 h = Swap16IfLE( h );
440 436
441 con->read( &encoding, 4 ); 437 con->read( &encoding, 4 );
442 438
443 // CARD32 encodingLocal = Swap32IfLE( encoding ); 439 // CARD32 encodingLocal = Swap32IfLE( encoding );
444 // qWarning( "Rect: x=%d, y= %d, w=%d, h=%d, encoding=%ld", 440 // owarn << "Rect: x=" << x << ", y= " << y << ", w=" << w << ", h=" << h
445 // x, y, w, h, encodingLocal ); 441 // << ", encoding= " << encodingLocal << oendl;
446 442
447 // 443 //
448 // Each encoding needs to be handled differently. Some require 444 // Each encoding needs to be handled differently. Some require
449 // waiting for more data, but others like a copyrect do not. 445 // waiting for more data, but others like a copyrect do not.
450 // Our constants have already been byte swapped, so we use 446 // Our constants have already been byte swapped, so we use
451 // the remote value as is. 447 // the remote value as is.
452 // 448 //
453 if ( encoding == RawEncoding ) { 449 if ( encoding == RawEncoding ) {
454 // owarn << "Raw encoding" << oendl; 450 // owarn << "Raw encoding" << oendl;
455 handleRawRect(); 451 handleRawRect();
456 } 452 }
457 else if ( encoding == CopyRectEncoding ) { 453 else if ( encoding == CopyRectEncoding ) {
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 6c5f5ea..211314b 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -101,27 +101,27 @@ namespace {
101 inline void IconViewItem::setPixmap( const QPixmap & icon, bool recalc, bool redraw) 101 inline void IconViewItem::setPixmap( const QPixmap & icon, bool recalc, bool redraw)
102 { 102 {
103 m_Pixset = true; 103 m_Pixset = true;
104 calcRect(text()); 104 calcRect(text());
105 } 105 }
106 inline void IconViewItem::setPixmap( const QPixmap & icon) 106 inline void IconViewItem::setPixmap( const QPixmap & icon)
107 { 107 {
108 m_Pixset = true; 108 m_Pixset = true;
109 calcRect(text()); 109 calcRect(text());
110 } 110 }
111 111
112 inline QPixmap* IconViewItem::pixmap()const { 112 inline QPixmap* IconViewItem::pixmap()const {
113// qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d", 113// owarn << "Name is " << m_path.right( 15 ) << " rect is " << rect().x() << " " << rect().y()
114// rect().x(),rect().y(),rect().width(),rect().height(), 114// << " " << rect().width() << " " << rect().height() << " | " << iconView()->contentsX()
115// iconView()->contentsX(), iconView()->contentsY()); 115// << " " << iconView()->contentsY() << oendl;
116 116
117 if (textOnly()&&!m_isDir) { 117 if (textOnly()&&!m_isDir) {
118 if (!_emptyPix) _emptyPix = new QPixmap(0,0,1); 118 if (!_emptyPix) _emptyPix = new QPixmap(0,0,1);
119 return _emptyPix; 119 return _emptyPix;
120 } 120 }
121 if ( m_isDir ) 121 if ( m_isDir )
122 return _dirPix; 122 return _dirPix;
123 else{ 123 else{
124 if (!m_noInfo && !g_stringInf.contains( m_path ) ) { 124 if (!m_noInfo && !g_stringInf.contains( m_path ) ) {
125 currentView()->dirLister()->imageInfo( m_path ); 125 currentView()->dirLister()->imageInfo( m_path );
126 g_stringInf.insert( m_path, const_cast<IconViewItem*>(this)); 126 g_stringInf.insert( m_path, const_cast<IconViewItem*>(this));
127 } 127 }
diff --git a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp
index 36e5dcf..aa15d31 100644
--- a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp
+++ b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp
@@ -1,16 +1,19 @@
1#include "viewmodebutton.h" 1#include "viewmodebutton.h"
2 2
3/* OPIE */
3#include <opie2/odebug.h> 4#include <opie2/odebug.h>
5using namespace Opie::Core;
4 6
7/* QT */
5#include <qtoolbar.h> 8#include <qtoolbar.h>
6#include <qpopupmenu.h> 9#include <qpopupmenu.h>
7 10
8ViewModeButton::ViewModeButton( QToolBar* bar,int def ) 11ViewModeButton::ViewModeButton( QToolBar* bar,int def )
9 : QToolButton( bar ) 12 : QToolButton( bar )
10{ 13{
11 slotChange( def ); 14 slotChange( def );
12 QPopupMenu *pop= new QPopupMenu( this ); 15 QPopupMenu *pop= new QPopupMenu( this );
13 pop->setCheckable( true ); 16 pop->setCheckable( true );
14 pop->insertItem( tr("Thumbnail and Imageinfo"), 1 ); 17 pop->insertItem( tr("Thumbnail and Imageinfo"), 1 );
15 pop->insertItem( tr("Thumbnail and Name" ), 2 ); 18 pop->insertItem( tr("Thumbnail and Name" ), 2 );
16 pop->insertItem( tr("Name Only" ), 3 ); 19 pop->insertItem( tr("Name Only" ), 3 );
@@ -31,15 +34,15 @@ void ViewModeButton::slotChange( int i ) {
31 switch( i ) { 34 switch( i ) {
32 case 1: 35 case 1:
33 name = "opie-eye/opie-eye-thumb"; 36 name = "opie-eye/opie-eye-thumb";
34 break; 37 break;
35 case 2: 38 case 2:
36 name = "opie-eye/opie-eye-thumbonly"; 39 name = "opie-eye/opie-eye-thumbonly";
37 break; 40 break;
38 case 3: 41 case 3:
39 name = "opie-eye/opie-eye-textview"; 42 name = "opie-eye/opie-eye-textview";
40 break; 43 break;
41 } 44 }
42 45
43 qWarning("foo %d" +name, i ); 46 owarn << "foo " << name << oendl;
44 setIconSet( Resource::loadIconSet( name ) ); 47 setIconSet( Resource::loadIconSet( name ) );
45} 48}
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index 04c50d9..f81066e 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -1,152 +1,157 @@
1 1
2#include <signal.h> 2#include "device.h"
3 3
4/* OPIE */
4#include <opie2/oprocess.h> 5#include <opie2/oprocess.h>
6#include <opie2/odebug.h>
7using namespace Opie::Core;
8
9/* STD */
10#include <signal.h>
5 11
6#include "device.h"
7 12
8using namespace OpieTooth; 13using namespace OpieTooth;
9 14
10using Opie::Core::OProcess; 15using Opie::Core::OProcess;
11namespace { 16namespace {
12 int parsePid( const QCString& par ){ 17 int parsePid( const QCString& par ){
13 int id=0; 18 int id=0;
14 QString string( par ); 19 QString string( par );
15 QStringList list = QStringList::split( '\n', string ); 20 QStringList list = QStringList::split( '\n', string );
16 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ 21 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
17 qWarning("parsePID: %s", (*it).latin1() ); 22 owarn << "parsePID: " << (*it).latin1() << oendl;
18 if( !(*it).startsWith("CSR") ){ 23 if( !(*it).startsWith("CSR") ){
19 id = (*it).toInt(); 24 id = (*it).toInt();
20 break; 25 break;
21 } 26 }
22 } 27 }
23 return id; 28 return id;
24 } 29 }
25} 30}
26 31
27Device::Device(const QString &device, const QString &mode, const QString &speed ) 32Device::Device(const QString &device, const QString &mode, const QString &speed )
28 : QObject(0, "device") { 33 : QObject(0, "device") {
29 34
30 qWarning("OpieTooth::Device create" ); 35 owarn << "OpieTooth::Device create" << oendl;
31 m_hci = 0; 36 m_hci = 0;
32 m_process = 0; 37 m_process = 0;
33 m_attached = false; 38 m_attached = false;
34 m_device = device; 39 m_device = device;
35 m_mode = mode; 40 m_mode = mode;
36 m_speed = speed; 41 m_speed = speed;
37 attach(); 42 attach();
38} 43}
39Device::~Device(){ 44Device::~Device(){
40 detach(); 45 detach();
41} 46}
42void Device::attach(){ 47void Device::attach(){
43 qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() ); 48 owarn << "attaching " << m_device.latin1() << " " << m_mode.latin1() << " " << m_speed.latin1() << oendl;
44 if(m_process == 0 ){ 49 if(m_process == 0 ){
45 m_output.resize(0); 50 m_output.resize(0);
46 qWarning("new process to create" ); 51 owarn << "new process to create" << oendl;
47 m_process = new OProcess(); 52 m_process = new OProcess();
48 *m_process << "hciattach"; 53 *m_process << "hciattach";
49 *m_process << "-p"; 54 *m_process << "-p";
50 *m_process << m_device << m_mode << m_speed; 55 *m_process << m_device << m_mode << m_speed;
51 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), 56 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ),
52 this, SLOT( slotExited(Opie::Core::OProcess* ) ) ); 57 this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
53 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ), 58 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ),
54 this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int ) ) ); 59 this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int ) ) );
55 connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ), 60 connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ),
56 this, SLOT(slotStdErr(Opie::Core::OProcess*,char*,int) ) ); 61 this, SLOT(slotStdErr(Opie::Core::OProcess*,char*,int) ) );
57 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ 62 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){
58 qWarning("Could not start" ); 63 owarn << "Could not start" << oendl;
59 delete m_process; 64 delete m_process;
60 m_process = 0; 65 m_process = 0;
61 } 66 }
62 }; 67 };
63} 68}
64void Device::detach(){ 69void Device::detach(){
65 delete m_hci; 70 delete m_hci;
66 delete m_process; 71 delete m_process;
67 // kill the pid we got 72 // kill the pid we got
68 if(m_attached ){ 73 if(m_attached ){
69 //kill the pid 74 //kill the pid
70 qWarning( "killing" ); 75 warn << "killing" << oendl;
71 kill(pid, 9); 76 kill(pid, 9);
72 } 77 }
73 qWarning("detached" ); 78 owarn << "detached" << oendl;
74} 79}
75bool Device::isLoaded()const{ 80bool Device::isLoaded()const{
76 return m_attached; 81 return m_attached;
77} 82}
78QString Device::devName()const { 83QString Device::devName()const {
79 return QString::fromLatin1("hci0"); 84 return QString::fromLatin1("hci0");
80}; 85};
81void Device::slotExited( OProcess* proc) 86void Device::slotExited( OProcess* proc)
82{ 87{
83 qWarning("prcess exited" ); 88 owarn << "prcess exited" << oendl;
84 if(proc== m_process ){ 89 if(proc== m_process ){
85 qWarning("proc == m_process" ); 90 owarn << "proc == m_process" << oendl;
86 if( m_process->normalExit() ){ // normal exit 91 if( m_process->normalExit() ){ // normal exit
87 qWarning("normalExit" ); 92 owarn << "normalExit" << oendl;
88 int ret = m_process->exitStatus(); 93 int ret = m_process->exitStatus();
89 if( ret == 0 ){ // attached 94 if( ret == 0 ){ // attached
90 qWarning("attached" ); 95 owarn << "attached" << oendl;
91 qWarning("Output: %s", m_output.data() ); 96 owarn << "Output: " << m_output.data() << oendl;
92 pid = parsePid( m_output ); 97 pid = parsePid( m_output );
93 qWarning("Pid = %d", pid ); 98 owarn << "Pid = " << pid << oendl;
94 // now hciconfig hci0 up ( determine hciX FIXME) 99 // now hciconfig hci0 up ( determine hciX FIXME)
95 // and call hciconfig hci0 up 100 // and call hciconfig hci0 up
96 // FIXME hardcoded to hci0 now :( 101 // FIXME hardcoded to hci0 now :(
97 m_hci = new OProcess( ); 102 m_hci = new OProcess( );
98 *m_hci << "hciconfig"; 103 *m_hci << "hciconfig";
99 *m_hci << "hci0 up"; 104 *m_hci << "hci0 up";
100 connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ), 105 connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ),
101 this, SLOT( slotExited(Opie::Core::OProcess* ) ) ); 106 this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
102 if(!m_hci->start() ){ 107 if(!m_hci->start() ){
103 qWarning("could not start" ); 108 owarn << "could not start" << oendl;
104 m_attached = false; 109 m_attached = false;
105 emit device("hci0", false ); 110 emit device("hci0", false );
106 } 111 }
107 }else{ 112 }else{
108 qWarning("crass" ); 113 owarn << "crass" << oendl;
109 m_attached = false; 114 m_attached = false;
110 emit device("hci0", false ); 115 emit device("hci0", false );
111 116
112 } 117 }
113 } 118 }
114 delete m_process; 119 delete m_process;
115 m_process = 0; 120 m_process = 0;
116 }else if(proc== m_hci ){ 121 }else if(proc== m_hci ){
117 qWarning("M HCI exited" ); 122 owarn << "M HCI exited" << oendl;
118 if( m_hci->normalExit() ){ 123 if( m_hci->normalExit() ){
119 qWarning("normal exit" ); 124 owarn << "normal exit" << oendl;
120 int ret = m_hci->exitStatus(); 125 int ret = m_hci->exitStatus();
121 if( ret == 0 ){ 126 if( ret == 0 ){
122 qWarning("attached really really attached" ); 127 owarn << "attached really really attached" << oendl;
123 m_attached = true; 128 m_attached = true;
124 emit device("hci0", true ); 129 emit device("hci0", true );
125 }else{ 130 }else{
126 qWarning( "failed" ); 131 owarn << "failed" << oendl;
127 emit device("hci0", false ); 132 emit device("hci0", false );
128 m_attached = false; 133 m_attached = false;
129 } 134 }
130 }// normal exit 135 }// normal exit
131 delete m_hci; 136 delete m_hci;
132 m_hci = 0; 137 m_hci = 0;
133 } 138 }
134} 139}
135void Device::slotStdOut(OProcess* proc, char* chars, int len) 140void Device::slotStdOut(OProcess* proc, char* chars, int len)
136{ 141{
137 qWarning("std out" ); 142 owarn << "std out" << oendl;
138 if( len <1 ){ 143 if( len <1 ){
139 qWarning( "len < 1 " ); 144 owarn << "len < 1 " << oendl;
140 return; 145 return;
141 } 146 }
142 if(proc == m_process ){ 147 if(proc == m_process ){
143 QCString string( chars, len+1 ); // \0 == +1 148 QCString string( chars, len+1 ); // \0 == +1
144 qWarning("output: %s", string.data() ); 149 owarn << "output: " << string.data() << oendl;
145 m_output.append( string.data() ); 150 m_output.append( string.data() );
146 } 151 }
147} 152}
148void Device::slotStdErr(OProcess* proc, char* chars, int len) 153void Device::slotStdErr(OProcess* proc, char* chars, int len)
149{ 154{
150 qWarning("std err" ); 155 owarn << "std err" << oendl;
151 slotStdOut( proc, chars, len ); 156 slotStdOut( proc, chars, len );
152} 157}
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index 18e1df9..76d9127 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -1,27 +1,28 @@
1 1
2
3#include <opie2/oprocess.h>
4
5#include "parser.h" 2#include "parser.h"
6#include "manager.h" 3#include "manager.h"
7 4
5#include <opie2/oprocess.h>
6#include <opie2/odebug.h>
7using namespace Opie::Core;
8
8 9
9using namespace OpieTooth; 10using namespace OpieTooth;
10 11
11using Opie::Core::OProcess; 12using Opie::Core::OProcess;
12Manager::Manager( const QString& dev ) 13Manager::Manager( const QString& dev )
13 : QObject() 14 : QObject()
14{ 15{
15 qWarning("created"); 16 owarn << "created" << oendl;
16 m_device = dev; 17 m_device = dev;
17 m_hcitool = 0; 18 m_hcitool = 0;
18 m_sdp = 0; 19 m_sdp = 0;
19} 20}
20Manager::Manager( Device* /*dev*/ ) 21Manager::Manager( Device* /*dev*/ )
21 : QObject() 22 : QObject()
22{ 23{
23 m_hcitool = 0; 24 m_hcitool = 0;
24 m_sdp = 0; 25 m_sdp = 0;
25} 26}
26Manager::Manager() 27Manager::Manager()
27 : QObject() 28 : QObject()
@@ -48,34 +49,34 @@ void Manager::isAvailable( const QString& device ){
48 if (!l2ping->start() ) { 49 if (!l2ping->start() ) {
49 emit available( device, false ); 50 emit available( device, false );
50 delete l2ping; 51 delete l2ping;
51 } 52 }
52 53
53} 54}
54 55
55void Manager::isAvailable( Device* /*dev*/ ){ 56void Manager::isAvailable( Device* /*dev*/ ){
56 57
57 58
58} 59}
59void Manager::searchDevices( const QString& device ){ 60void Manager::searchDevices( const QString& device ){
60 qWarning("search devices"); 61 owarn << "search devices" << oendl;
61 OProcess* hcitool = new OProcess(); 62 OProcess* hcitool = new OProcess();
62 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() ); 63 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() );
63 *hcitool << "hcitool" << "scan"; 64 *hcitool << "hcitool" << "scan";
64 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) , 65 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) ,
65 this, SLOT(slotHCIExited(Opie::Core::OProcess* ) ) ); 66 this, SLOT(slotHCIExited(Opie::Core::OProcess* ) ) );
66 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), 67 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
67 this, SLOT(slotHCIOut(Opie::Core::OProcess*, char*, int ) ) ); 68 this, SLOT(slotHCIOut(Opie::Core::OProcess*, char*, int ) ) );
68 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 69 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
69 qWarning("could not start"); 70 owarn << "could not start" << oendl;
70 RemoteDevice::ValueList list; 71 RemoteDevice::ValueList list;
71 emit foundDevices( device, list ); 72 emit foundDevices( device, list );
72 delete hcitool; 73 delete hcitool;
73 } 74 }
74} 75}
75 76
76void Manager::searchDevices(Device* /*d*/ ){ 77void Manager::searchDevices(Device* /*d*/ ){
77 78
78 79
79} 80}
80void Manager::addService(const QString& name ){ 81void Manager::addService(const QString& name ){
81 OProcess proc; 82 OProcess proc;
@@ -98,31 +99,31 @@ void Manager::removeService( const QString& name ){
98 bo = false; 99 bo = false;
99 emit removedService( name, bo ); 100 emit removedService( name, bo );
100} 101}
101void Manager::removeServices( const QStringList& list){ 102void Manager::removeServices( const QStringList& list){
102 QStringList::ConstIterator it; 103 QStringList::ConstIterator it;
103 for (it = list.begin(); it != list.end(); ++it ) 104 for (it = list.begin(); it != list.end(); ++it )
104 removeService( (*it) ); 105 removeService( (*it) );
105} 106}
106void Manager::searchServices( const QString& remDevice ){ 107void Manager::searchServices( const QString& remDevice ){
107 OProcess *m_sdp =new OProcess(); 108 OProcess *m_sdp =new OProcess();
108 *m_sdp << "sdptool" << "browse" << remDevice; 109 *m_sdp << "sdptool" << "browse" << remDevice;
109 m_sdp->setName( remDevice.latin1() ); 110 m_sdp->setName( remDevice.latin1() );
110 qWarning("search Services for %s", remDevice.latin1() ); 111 owarn << "search Services for " << remDevice.latin1() << oendl;
111 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ), 112 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ),
112 this, SLOT(slotSDPExited(Opie::Core::OProcess* ) ) ); 113 this, SLOT(slotSDPExited(Opie::Core::OProcess* ) ) );
113 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), 114 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
114 this, SLOT(slotSDPOut(Opie::Core::OProcess*, char*, int) ) ); 115 this, SLOT(slotSDPOut(Opie::Core::OProcess*, char*, int) ) );
115 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 116 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
116 qWarning("could not start sdptool" ); 117 owarn << "could not start sdptool" << oendl;
117 delete m_sdp; 118 delete m_sdp;
118 Services::ValueList list; 119 Services::ValueList list;
119 emit foundServices( remDevice, list ); 120 emit foundServices( remDevice, list );
120 } 121 }
121} 122}
122void Manager::searchServices( const RemoteDevice& dev){ 123void Manager::searchServices( const RemoteDevice& dev){
123 searchServices( dev.mac() ); 124 searchServices( dev.mac() );
124} 125}
125QString Manager::toDevice( const QString& /*mac*/ ){ 126QString Manager::toDevice( const QString& /*mac*/ ){
126 return QString::null; 127 return QString::null;
127} 128}
128QString Manager::toMac( const QString &/*device*/ ){ 129QString Manager::toMac( const QString &/*device*/ ){
@@ -131,128 +132,128 @@ QString Manager::toMac( const QString &/*device*/ ){
131void Manager::slotProcessExited(OProcess* proc ) { 132void Manager::slotProcessExited(OProcess* proc ) {
132 bool conn= false; 133 bool conn= false;
133 if (proc->normalExit() && proc->exitStatus() == 0 ) 134 if (proc->normalExit() && proc->exitStatus() == 0 )
134 conn = true; 135 conn = true;
135 136
136 QString name = QString::fromLatin1(proc->name() ); 137 QString name = QString::fromLatin1(proc->name() );
137 emit available( name, conn ); 138 emit available( name, conn );
138 delete proc; 139 delete proc;
139} 140}
140void Manager::slotSDPOut(OProcess* proc, char* ch, int len) 141void Manager::slotSDPOut(OProcess* proc, char* ch, int len)
141{ 142{
142 QCString str(ch, len+1 ); 143 QCString str(ch, len+1 );
143 qWarning("SDP:%s", str.data() ); 144 owarn << "SDP:" << str.data() << oendl;
144 QMap<QString, QString>::Iterator it; 145 QMap<QString, QString>::Iterator it;
145 it = m_out.find(proc->name() ); 146 it = m_out.find(proc->name() );
146 QString string; 147 QString string;
147 if ( it != m_out.end() ) { 148 if ( it != m_out.end() ) {
148 string = it.data(); 149 string = it.data();
149 } 150 }
150 string.append( str ); 151 string.append( str );
151 m_out.replace( proc->name(), string ); 152 m_out.replace( proc->name(), string );
152 153
153} 154}
154void Manager::slotSDPExited( OProcess* proc) 155void Manager::slotSDPExited( OProcess* proc)
155{ 156{
156 qWarning("proc name %s", proc->name() ); 157 owarn << "proc name " << proc->name() << oendl;
157 Services::ValueList list; 158 Services::ValueList list;
158 if (proc->normalExit() ) { 159 if (proc->normalExit() ) {
159 QMap<QString, QString>::Iterator it = m_out.find( proc->name() ); 160 QMap<QString, QString>::Iterator it = m_out.find( proc->name() );
160 if ( it != m_out.end() ) { 161 if ( it != m_out.end() ) {
161 qWarning("found process" ); 162 owarn << "found process" << oendl;
162 list = parseSDPOutput( it.data() ); 163 list = parseSDPOutput( it.data() );
163 m_out.remove( it ); 164 m_out.remove( it );
164 } 165 }
165 } 166 }
166 emit foundServices( proc->name(), list ); 167 emit foundServices( proc->name(), list );
167 delete proc; 168 delete proc;
168} 169}
169Services::ValueList Manager::parseSDPOutput( const QString& out ) { 170Services::ValueList Manager::parseSDPOutput( const QString& out ) {
170 Services::ValueList list; 171 Services::ValueList list;
171 qWarning("parsing output" ); 172 owarn << "parsing output" << oendl;
172 Parser parser( out ); 173 Parser parser( out );
173 list = parser.services(); 174 list = parser.services();
174 return list; 175 return list;
175} 176}
176 177
177void Manager::slotHCIExited(OProcess* proc ) { 178void Manager::slotHCIExited(OProcess* proc ) {
178 qWarning("process exited"); 179 owarn << "process exited" << oendl;
179 RemoteDevice::ValueList list; 180 RemoteDevice::ValueList list;
180 if (proc->normalExit() ) { 181 if (proc->normalExit() ) {
181 qWarning("normalExit %s", proc->name() ); 182 owarn << "normalExit " << proc->name() << oendl;
182 QMap<QString, QString>::Iterator it = m_devices.find(proc->name() ); 183 QMap<QString, QString>::Iterator it = m_devices.find(proc->name() );
183 if (it != m_devices.end() ) { 184 if (it != m_devices.end() ) {
184 qWarning("!= end ;)"); 185 owarn << "!= end ;)" << oendl;
185 list = parseHCIOutput( it.data() ); 186 list = parseHCIOutput( it.data() );
186 m_devices.remove( it ); 187 m_devices.remove( it );
187 } 188 }
188 } 189 }
189 emit foundDevices( proc->name(), list ); 190 emit foundDevices( proc->name(), list );
190 delete proc; 191 delete proc;
191} 192}
192void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { 193void Manager::slotHCIOut(OProcess* proc, char* ch, int len) {
193 QCString str( ch, len+1 ); 194 QCString str( ch, len+1 );
194 qWarning("hci: %s", str.data() ); 195 owarn << "hci: " << str.data() oendl;
195 QMap<QString, QString>::Iterator it; 196 QMap<QString, QString>::Iterator it;
196 it = m_devices.find( proc->name() ); 197 it = m_devices.find( proc->name() );
197 qWarning("proc->name %s", proc->name() ); 198 owarn << "proc->name " << proc->name() << oendl;
198 QString string; 199 QString string;
199 if (it != m_devices.end() ) { 200 if (it != m_devices.end() ) {
200 qWarning("slotHCIOut "); 201 owarn << "slotHCIOut " << oendl;
201 string = it.data(); 202 string = it.data();
202 } 203 }
203 string.append( str ); 204 string.append( str );
204 205
205 m_devices.replace( proc->name(), string ); 206 m_devices.replace( proc->name(), string );
206} 207}
207RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { 208RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) {
208 qWarning("parseHCI %s", output.latin1() ); 209 owarn << "parseHCI " << output.latin1() << oendl;
209 RemoteDevice::ValueList list; 210 RemoteDevice::ValueList list;
210 QStringList strList = QStringList::split('\n', output ); 211 QStringList strList = QStringList::split('\n', output );
211 QStringList::Iterator it; 212 QStringList::Iterator it;
212 QString str; 213 QString str;
213 for ( it = strList.begin(); it != strList.end(); ++it ) { 214 for ( it = strList.begin(); it != strList.end(); ++it ) {
214 str = (*it).stripWhiteSpace(); 215 str = (*it).stripWhiteSpace();
215 qWarning("OpieTooth %s", str.latin1() ); 216 owarn << "OpieTooth " << str.latin1() << oendl;
216 int pos = str.findRev(':' ); 217 int pos = str.findRev(':' );
217 if ( pos > 0 ) { 218 if ( pos > 0 ) {
218 QString mac = str.left(17 ); 219 QString mac = str.left(17 );
219 str.remove( 0, 17 ); 220 str.remove( 0, 17 );
220 qWarning("mac %s", mac.latin1() ); 221 owarn << "mac " << mac.latin1() << oendl;
221 qWarning("rest:%s", str.latin1() ); 222 owarn << "rest: " << str.latin1() << oendl;
222 RemoteDevice rem( mac , str.stripWhiteSpace() ); 223 RemoteDevice rem( mac , str.stripWhiteSpace() );
223 list.append( rem ); 224 list.append( rem );
224 } 225 }
225 } 226 }
226 return list; 227 return list;
227} 228}
228 229
229////// hcitool cc and hcitool con 230////// hcitool cc and hcitool con
230 231
231/** 232/**
232 * Create it on the stack as don't care 233 * Create it on the stack as don't care
233 * so we don't need to care for it 234 * so we don't need to care for it
234 * cause hcitool gets reparented 235 * cause hcitool gets reparented
235 */ 236 */
236void Manager::connectTo( const QString& mac) { 237void Manager::connectTo( const QString& mac) {
237 OProcess proc; 238 OProcess proc;
238 proc << "hcitool"; 239 proc << "hcitool";
239 proc << "cc"; 240 proc << "cc";
240 proc << mac; 241 proc << mac;
241 proc.start(OProcess::DontCare); // the lib does not care at this point 242 proc.start(OProcess::DontCare); // the lib does not care at this point
242} 243}
243 244
244 245
245void Manager::searchConnections() { 246void Manager::searchConnections() {
246 qWarning("searching connections?"); 247 owarn << "searching connections?" << oendl;
247 OProcess* proc = new OProcess(); 248 OProcess* proc = new OProcess();
248 m_hcitoolCon = QString::null; 249 m_hcitoolCon = QString::null;
249 250
250 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ), 251 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
251 this, SLOT(slotConnectionExited( Opie::Core::OProcess*) ) ); 252 this, SLOT(slotConnectionExited( Opie::Core::OProcess*) ) );
252 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ), 253 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
253 this, SLOT(slotConnectionOutput(Opie::Core::OProcess*, char*, int) ) ); 254 this, SLOT(slotConnectionOutput(Opie::Core::OProcess*, char*, int) ) );
254 *proc << "hcitool"; 255 *proc << "hcitool";
255 *proc << "con"; 256 *proc << "con";
256 257
257 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 258 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
258 ConnectionState::ValueList list; 259 ConnectionState::ValueList list;
@@ -272,33 +273,33 @@ void Manager::slotConnectionOutput(OProcess* /*proc*/, char* cha, int len) {
272 //delete proc; 273 //delete proc;
273} 274}
274ConnectionState::ValueList Manager::parseConnections( const QString& out ) { 275ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
275 ConnectionState::ValueList list2; 276 ConnectionState::ValueList list2;
276 QStringList list = QStringList::split('\n', out ); 277 QStringList list = QStringList::split('\n', out );
277 QStringList::Iterator it; 278 QStringList::Iterator it;
278 // remove the first line ( "Connections:") 279 // remove the first line ( "Connections:")
279 it = list.begin(); 280 it = list.begin();
280 it = list.remove( it ); 281 it = list.remove( it );
281 for (; it != list.end(); ++it ) { 282 for (; it != list.end(); ++it ) {
282 QString row = (*it).stripWhiteSpace(); 283 QString row = (*it).stripWhiteSpace();
283 QStringList value = QStringList::split(' ', row ); 284 QStringList value = QStringList::split(' ', row );
284 qWarning("0: %s", value[0].latin1() ); 285 owan << "0: %s" << value[0].latin1() << oendl;
285 qWarning("1: %s", value[1].latin1() ); 286 owan << "1: %s" << value[1].latin1() << oendl;
286 qWarning("2: %s", value[2].latin1() ); 287 owan << "2: %s" << value[2].latin1() << oendl;
287 qWarning("3: %s", value[3].latin1() ); 288 owan << "3: %s" << value[3].latin1() << oendl;
288 qWarning("4: %s", value[4].latin1() ); 289 owan << "4: %s" << value[4].latin1() << oendl;
289 qWarning("5: %s", value[5].latin1() ); 290 owan << "5: %s" << value[5].latin1() << oendl;
290 qWarning("6: %s", value[6].latin1() ); 291 owan << "6: %s" << value[6].latin1() << oendl;
291 qWarning("7: %s", value[7].latin1() ); 292 owan << "7: %s" << value[7].latin1() << oendl;
292 qWarning("8: %s", value[8].latin1() ); 293 owan << "8: %s" << value[8].latin1() << oendl;
293 ConnectionState con; 294 ConnectionState con;
294 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); 295 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming );
295 con.setConnectionMode( value[1] ); 296 con.setConnectionMode( value[1] );
296 con.setMac( value[2] ); 297 con.setMac( value[2] );
297 con.setHandle( value[4].toInt() ); 298 con.setHandle( value[4].toInt() );
298 con.setState( value[6].toInt() ); 299 con.setState( value[6].toInt() );
299 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client ); 300 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client );
300 list2.append( con ); 301 list2.append( con );
301 } 302 }
302 return list2; 303 return list2;
303} 304}
304 305
diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc
index 8baf284..7e95907 100644
--- a/noncore/net/opietooth/lib/parser.cc
+++ b/noncore/net/opietooth/lib/parser.cc
@@ -1,199 +1,205 @@
1 1
2#include "parser.h"
3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7
8/* QT */
2#include <qstringlist.h> 9#include <qstringlist.h>
3 10
4#include "parser.h"
5 11
6using namespace OpieTooth; 12using namespace OpieTooth;
7 13
8namespace { 14namespace {
9 15
10 16
11 // "Test Foo Bar" (0x3456) 17 // "Test Foo Bar" (0x3456)
12 // @param ret Test Foo Bar 18 // @param ret Test Foo Bar
13 // @eturn 13398 19 // @eturn 13398
14 // tactic find " ( 20 // tactic find " (
15int convert( const QString& line, QString& ret ) { 21int convert( const QString& line, QString& ret ) {
16// qWarning("called"); 22// owarn << "called" << oendl;
17 ret = QString::null; 23 ret = QString::null;
18 int i = 0; 24 int i = 0;
19 int pos = line.findRev("\" ("); 25 int pos = line.findRev("\" (");
20 if ( pos > 0 ) { // it shouldn't be at pos 0 26 if ( pos > 0 ) { // it shouldn't be at pos 0
21 ret = line.left(pos ).stripWhiteSpace(); 27 ret = line.left(pos ).stripWhiteSpace();
22 // qWarning("ret: %s", ret.latin1() ); 28 // owarn << "ret: " << ret.latin1() << oendl;
23 ret = ret.replace(QRegExp("[\"]"), ""); 29 ret = ret.replace(QRegExp("[\"]"), "");
24 //qWarning("ret: %s", ret.latin1() ); 30 //owarn << "ret: " << ret.latin1() << oendl;
25 QString dummy = line.mid(pos + 5 ); 31 QString dummy = line.mid(pos + 5 );
26 //qWarning("dummy: %s", dummy.latin1() ); 32 //owarn << "dummy: " << dummy.latin1() << oendl;
27 dummy = dummy.replace(QRegExp("[)]"), ""); 33 dummy = dummy.replace(QRegExp("[)]"), "");
28 //qWarning("dummy: %s", dummy.latin1() ); 34 //owarn << "dummy: " << dummy.latin1() << oendl;
29// dummy = dummy.remove( dummy.length() -2, 1 ); // remove the ) 35// dummy = dummy.remove( dummy.length() -2, 1 ); // remove the )
30 bool ok; 36 bool ok;
31 i = dummy.toInt(&ok, 16 ); 37 i = dummy.toInt(&ok, 16 );
32 //if (ok ) { 38 //if (ok ) {
33 // qWarning("converted %d", i); 39 // owarn << "converted " << i << oendl;
34 //}else qWarning("failed" ); 40 //}else owarn << "failed" << oendl;
35 //qWarning("exiting"); 41 //owarn << "exiting" << oendl;
36 return i; 42 return i;
37 } 43 }
38 //qWarning("output %d", i ); 44 //owarn << "output " << i << oendl;
39 return i; 45 return i;
40} 46}
41 47
42}; 48};
43 49
44 50
45Parser::Parser(const QString& output ) { 51Parser::Parser(const QString& output ) {
46 parse( output ); 52 parse( output );
47} 53}
48void Parser::setText(const QString& output) { 54void Parser::setText(const QString& output) {
49 parse( output ); 55 parse( output );
50} 56}
51Services::ValueList Parser::services() const { 57Services::ValueList Parser::services() const {
52 return m_list; 58 return m_list;
53} 59}
54void Parser::parse( const QString& string) { 60void Parser::parse( const QString& string) {
55 m_list.clear(); 61 m_list.clear();
56 m_complete = true; 62 m_complete = true;
57 QStringList list = QStringList::split('\n', string,TRUE ); 63 QStringList list = QStringList::split('\n', string,TRUE );
58 QStringList::Iterator it; 64 QStringList::Iterator it;
59 for (it = list.begin(); it != list.end(); ++it ) { 65 for (it = list.begin(); it != list.end(); ++it ) {
60 //qWarning("line:%s:line", (*it).latin1() ); 66 //owarn << "line:" << (*it).latin1() << oendl;
61 if ( (*it).startsWith("Browsing") ) continue; 67 if ( (*it).startsWith("Browsing") ) continue;
62 68
63 if ( (*it).stripWhiteSpace().isEmpty() ) { // line is empty because a new Service begins 69 if ( (*it).stripWhiteSpace().isEmpty() ) { // line is empty because a new Service begins
64 qWarning("could add"); 70 owarn << "could add" << oendl;
65 // now see if complete and add 71 // now see if complete and add
66 if (m_complete ) { 72 if (m_complete ) {
67 if (!m_item.serviceName().isEmpty() ) 73 if (!m_item.serviceName().isEmpty() )
68 m_list.append( m_item ); 74 m_list.append( m_item );
69 Services serv; 75 Services serv;
70 m_item = serv; 76 m_item = serv;
71 m_complete = true; 77 m_complete = true;
72 continue; 78 continue;
73 } 79 }
74 } 80 }
75 if (parseName( (*it) ) ) ;//continue; 81 if (parseName( (*it) ) ) ;//continue;
76 if (parseRecHandle( (*it) ) ) ;//continue; 82 if (parseRecHandle( (*it) ) ) ;//continue;
77 if (parseClassId( (*it) ) ) ;//continue; 83 if (parseClassId( (*it) ) ) ;//continue;
78 if (parseProtocol( (*it) ) ) ;//continue; 84 if (parseProtocol( (*it) ) ) ;//continue;
79 if (parseProfile( (*it) ) ) ;//continue; 85 if (parseProfile( (*it) ) ) ;//continue;
80 } 86 }
81 // missed the last one 87 // missed the last one
82 if (m_complete) { 88 if (m_complete) {
83// qWarning("adding"); 89// owarn << "adding" << oendl;
84 if (!m_item.serviceName().isEmpty() ) 90 if (!m_item.serviceName().isEmpty() )
85 m_list.append(m_item ); 91 m_list.append(m_item );
86 } 92 }
87 QValueList<Services>::Iterator it2; 93 QValueList<Services>::Iterator it2;
88 94
89 if (m_list.isEmpty() ) 95 if (m_list.isEmpty() )
90 qWarning("m_list is empty"); 96 owarn << "m_list is empty" << oendl;
91 for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { 97 for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) {
92 qWarning("name %s", (*it2).serviceName().latin1() ); 98 owarn << "name " << (*it2).serviceName().latin1() << oendl;
93 } 99 }
94} 100}
95bool Parser::parseName( const QString& str) { 101bool Parser::parseName( const QString& str) {
96 if (str.startsWith("Service Name:") ) { 102 if (str.startsWith("Service Name:") ) {
97 m_item.setServiceName( str.mid(13).stripWhiteSpace() ); 103 m_item.setServiceName( str.mid(13).stripWhiteSpace() );
98 qWarning(m_item.serviceName() ); 104 owarn << m_item.serviceName() << oendl;
99 return true; 105 return true;
100 } 106 }
101 return false; 107 return false;
102} 108}
103bool Parser::parseRecHandle( const QString& str) { 109bool Parser::parseRecHandle( const QString& str) {
104 if (str.startsWith("Service RecHandle:" ) ) { 110 if (str.startsWith("Service RecHandle:" ) ) {
105 QString out = str.mid(18 ).stripWhiteSpace(); 111 QString out = str.mid(18 ).stripWhiteSpace();
106 qWarning("out %s", out.latin1() ); 112 owarn << "out " << out.latin1() << oendl;
107 int value = out.mid(2).toInt(&m_ok, 16 ); 113 int value = out.mid(2).toInt(&m_ok, 16 );
108 if (m_ok && (value != -1) ) 114 if (m_ok && (value != -1) )
109 m_complete = true; 115 m_complete = true;
110 else 116 else
111 m_complete = false; 117 m_complete = false;
112 qWarning("rec handle %d", value); 118 owarn << "rec handle " << value << oendl;
113 m_item.setRecHandle( value ); 119 m_item.setRecHandle( value );
114 return true; 120 return true;
115 121
116 } 122 }
117 return false; 123 return false;
118} 124}
119bool Parser::parseClassId( const QString& str) { 125bool Parser::parseClassId( const QString& str) {
120 if (str.startsWith("Service Class ID List:") ) { 126 if (str.startsWith("Service Class ID List:") ) {
121 qWarning("found class id" ); 127 owarn << "found class id" << oendl;
122 qWarning("line:%s", str.latin1() ); 128 owarn << "line: " << str.latin1() << oendl;
123 m_classOver = true; 129 m_classOver = true;
124 return true; 130 return true;
125 }else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place 131 }else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place
126 qWarning("line with class id" ); 132 owarn << "line with class id" << oendl;
127 qWarning("%s",str.latin1() ); 133 owarn << str.latin1() << oendl;
128 134
129 // "Obex Object Push" (0x1105) 135 // "Obex Object Push" (0x1105)
130 // find backwards the " and the from 0 to pos and the mid pos+1 136 // find backwards the " and the from 0 to pos and the mid pos+1
131 // then stripWhiteSpace add name replace '"' with "" 137 // then stripWhiteSpace add name replace '"' with ""
132 // and then convert 0x1105 toInt() 138 // and then convert 0x1105 toInt()
133 QString classes; 139 QString classes;
134 int ids; 140 int ids;
135 ids = convert( str, classes ); 141 ids = convert( str, classes );
136 qWarning("ids %d", ids ); 142 owarn << "ids " << ids << oendl;
137 m_item.insertClassId( ids, classes ); 143 m_item.insertClassId( ids, classes );
138 144
139 return true; 145 return true;
140 }else{ 146 }else{
141 qWarning("Else %d", m_classOver ); 147 owarn << "Else " << m_classOver << oendl;
142 m_classOver = false; 148 m_classOver = false;
143 } 149 }
144 return false; 150 return false;
145} 151}
146bool Parser::parseProtocol( const QString& str) { 152bool Parser::parseProtocol( const QString& str) {
147 if (str.startsWith("Protocol Descriptor List:") ) { 153 if (str.startsWith("Protocol Descriptor List:") ) {
148 m_protocolOver = true; 154 m_protocolOver = true;
149 m_protocolAdded = false; 155 m_protocolAdded = false;
150 return true; 156 return true;
151 157
152 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100) 158 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100)
153 qWarning("double protocol filter"); 159 owarn << "double protocol filter" << oendl;
154 160
155 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now 161 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now
156 Services::ProtocolDescriptor desc( m_protName, m_protId ); 162 Services::ProtocolDescriptor desc( m_protName, m_protId );
157 m_item.insertProtocolDescriptor( desc ); 163 m_item.insertProtocolDescriptor( desc );
158 } 164 }
159 m_protocolAdded = false; 165 m_protocolAdded = false;
160 { // the find function 166 { // the find function
161 m_protId = convert(str, m_protName ); 167 m_protId = convert(str, m_protName );
162 } 168 }
163 return true; 169 return true;
164 }else if (m_protocolOver && str.startsWith(" ") ) { 170 }else if (m_protocolOver && str.startsWith(" ") ) {
165 qWarning("tripple protocol filter"); 171 owarn << "tripple protocol filter" << oendl;
166 m_protocolAdded = true; 172 m_protocolAdded = true;
167 QString dummy = str.stripWhiteSpace(); 173 QString dummy = str.stripWhiteSpace();
168 int pos = dummy.findRev(':'); 174 int pos = dummy.findRev(':');
169 if ( pos > -1 ) { 175 if ( pos > -1 ) {
170 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt(); 176 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt();
171 Services::ProtocolDescriptor desc( m_protName, m_protId, port ); 177 Services::ProtocolDescriptor desc( m_protName, m_protId, port );
172 m_item.insertProtocolDescriptor( desc ); 178 m_item.insertProtocolDescriptor( desc );
173 } 179 }
174 return true; 180 return true;
175 }else if (m_protocolOver ) { 181 }else if (m_protocolOver ) {
176 m_protocolOver = false; 182 m_protocolOver = false;
177 } 183 }
178 return false; 184 return false;
179} 185}
180bool Parser::parseProfile( const QString& str) { 186bool Parser::parseProfile( const QString& str) {
181 if (str.startsWith("Profile Descriptor List:") ) { 187 if (str.startsWith("Profile Descriptor List:") ) {
182 m_profOver = true; 188 m_profOver = true;
183 }else if ( m_profOver && str.startsWith(" ") ) { 189 }else if ( m_profOver && str.startsWith(" ") ) {
184 m_profId = convert( str, m_profName ); 190 m_profId = convert( str, m_profName );
185 }else if ( m_profOver && str.startsWith(" ") ) { 191 }else if ( m_profOver && str.startsWith(" ") ) {
186 // now find 192 // now find
187 int pos = str.findRev(':'); 193 int pos = str.findRev(':');
188 if ( pos > 0 ) { 194 if ( pos > 0 ) {
189 int dummy = str.mid(pos+1 ).stripWhiteSpace().toInt(); 195 int dummy = str.mid(pos+1 ).stripWhiteSpace().toInt();
190 qWarning("dummyInt:%d", dummy ); 196 owarn << "dummyInt: " << dummy << oendl;
191 Services::ProfileDescriptor desc( m_profName, m_profId, dummy ); 197 Services::ProfileDescriptor desc( m_profName, m_profId, dummy );
192 m_item.insertProfileDescriptor(desc); 198 m_item.insertProfileDescriptor(desc);
193 } 199 }
194 }else 200 }else
195 m_profOver = false; 201 m_profOver = false;
196 202
197 203
198 return false; 204 return false;
199} 205}
diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc
index ab0b3af..0c6cf12 100644
--- a/noncore/settings/mediummount/mediumglobal.cc
+++ b/noncore/settings/mediummount/mediumglobal.cc
@@ -1,26 +1,31 @@
1 1
2#include "mediumglobal.h"
3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7#include <qpe/config.h>
2 8
9/* QT */
3#include <qlineedit.h> 10#include <qlineedit.h>
4#include <qcheckbox.h> 11#include <qcheckbox.h>
5#include <qlabel.h> 12#include <qlabel.h>
6#include <qabstractlayout.h> // spacer item 13#include <qabstractlayout.h> // spacer item
7#include <qlayout.h> 14#include <qlayout.h>
8#include <qframe.h> 15#include <qframe.h>
9#include <qgroupbox.h> 16#include <qgroupbox.h>
10#include <qwhatsthis.h> 17#include <qwhatsthis.h>
11 18
12#include <qpe/config.h>
13 19
14#include "mediumglobal.h"
15 20
16using namespace MediumMountSetting; 21using namespace MediumMountSetting;
17 22
18/* TRANSLATOR MediumMountSetting::MediumGlobalWidget */ 23/* TRANSLATOR MediumMountSetting::MediumGlobalWidget */
19 24
20MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name ) 25MediumGlobalWidget::MediumGlobalWidget(QWidget *wid, const char *name )
21 : QWidget( wid, name, WStyle_ContextHelp ) 26 : QWidget( wid, name, WStyle_ContextHelp )
22{ 27{
23 m_config = 0; 28 m_config = 0;
24 initGUI(); 29 initGUI();
25 readConfig(); 30 readConfig();
26 31
@@ -143,25 +148,25 @@ void MediumGlobalWidget::writeConfig()
143MediumGlobalWidget::~MediumGlobalWidget() 148MediumGlobalWidget::~MediumGlobalWidget()
144{ 149{
145 delete m_config; 150 delete m_config;
146} 151}
147void MediumGlobalWidget::slotGlobalChanged() 152void MediumGlobalWidget::slotGlobalChanged()
148{ 153{
149 int mode = GLOBAL_DISABLED; 154 int mode = GLOBAL_DISABLED;
150 bool enabled = false; 155 bool enabled = false;
151 if( ( enabled =m_useglobal->isChecked() ) ){ 156 if( ( enabled =m_useglobal->isChecked() ) ){
152 mode = GLOBAL_ENABLED; 157 mode = GLOBAL_ENABLED;
153 }else 158 }else
154 mode = GLOBAL_DISABLED; 159 mode = GLOBAL_DISABLED;
155 qWarning("enabled = %d", enabled ); 160 owarn << "enabled = " << enabled << oendl;
156 m_all->setEnabled ( enabled ); 161 m_all->setEnabled ( enabled );
157 m_audio->setEnabled( enabled ); 162 m_audio->setEnabled( enabled );
158 m_image->setEnabled( enabled ); 163 m_image->setEnabled( enabled );
159 m_text->setEnabled ( enabled ); 164 m_text->setEnabled ( enabled );
160 m_video->setEnabled ( enabled ); 165 m_video->setEnabled ( enabled );
161 slotAllChanged(); 166 slotAllChanged();
162 167
163 emit globalStateChanged( mode ); 168 emit globalStateChanged( mode );
164} 169}
165void MediumGlobalWidget::slotEnableChecking() 170void MediumGlobalWidget::slotEnableChecking()
166{ 171{
167 int mode = ENABLE_CHECKS; 172 int mode = ENABLE_CHECKS;
diff --git a/noncore/styles/theme/othemebase.h b/noncore/styles/theme/othemebase.h
index e691692..5519798 100644
--- a/noncore/styles/theme/othemebase.h
+++ b/noncore/styles/theme/othemebase.h
@@ -9,24 +9,29 @@
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18#ifndef __OTHEMEBASE_H 18#ifndef __OTHEMEBASE_H
19#define __OTHEMEBASE_H 19#define __OTHEMEBASE_H
20 20
21/* OPIE */
22#include <opie2/odebug.h>
23using namespace Opie::Core;
24
25/* QT */
21#include <qdatetime.h> 26#include <qdatetime.h>
22#include <qtimer.h> 27#include <qtimer.h>
23#include <qwindowsstyle.h> 28#include <qwindowsstyle.h>
24#include <qpixmap.h> 29#include <qpixmap.h>
25#include <qpe/config.h> 30#include <qpe/config.h>
26#include <qimage.h> 31#include <qimage.h>
27#include <qintcache.h> 32#include <qintcache.h>
28#include <qstring.h> 33#include <qstring.h>
29#include <qpalette.h> 34#include <qpalette.h>
30 35
31#define WIDGETS 54 36#define WIDGETS 54
32 37
@@ -57,25 +62,25 @@ private:
57 class OThemePixmapPrivate; 62 class OThemePixmapPrivate;
58 OThemePixmapPrivate *d; 63 OThemePixmapPrivate *d;
59}; 64};
60 65
61inline QPixmap* OThemePixmap::border( BorderType type ) 66inline QPixmap* OThemePixmap::border( BorderType type )
62{ 67{
63 return ( b[ type ] ); 68 return ( b[ type ] );
64} 69}
65 70
66inline void OThemePixmap::setBorder( BorderType type, const QPixmap &p ) 71inline void OThemePixmap::setBorder( BorderType type, const QPixmap &p )
67{ 72{
68 if ( b[ type ] ) { 73 if ( b[ type ] ) {
69 qWarning( "OThemePixmap: Overwriting existing border!" ); 74 owarn << "OThemePixmap: Overwriting existing border!" << oendl;
70 delete( b[ type ] ); 75 delete( b[ type ] );
71 } 76 }
72 b[ type ] = new QPixmap( p ); 77 b[ type ] = new QPixmap( p );
73} 78}
74 79
75inline void OThemePixmap::updateAccessed() 80inline void OThemePixmap::updateAccessed()
76{ 81{
77 if (t) 82 if (t)
78 t->start(); 83 t->start();
79} 84}
80 85
81inline bool OThemePixmap::isOld() 86inline bool OThemePixmap::isOld()