summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/alarmserver.cpp5
-rw-r--r--library/applnk.cpp4
-rw-r--r--library/categoryedit_p.cpp3
-rw-r--r--library/categorymenu.cpp2
-rw-r--r--library/config.cpp2
-rw-r--r--library/datebookdb.cpp5
-rw-r--r--library/datebookmonth.cpp5
-rw-r--r--library/filemanager.cpp3
-rw-r--r--library/fileselector.cpp2
-rw-r--r--library/finddialog.cpp1
-rw-r--r--library/findwidget_p.cpp6
-rw-r--r--library/fontdatabase.cpp2
-rw-r--r--library/global.cpp2
-rw-r--r--library/imageedit.cpp1
-rw-r--r--library/ir.cpp2
-rw-r--r--library/lnkproperties.cpp3
-rw-r--r--library/mimetype.cpp4
-rw-r--r--library/qcopenvelope_qws.cpp2
-rw-r--r--library/qdawg.cpp2
-rw-r--r--library/qpeapplication.cpp1
-rw-r--r--library/qpemenubar.cpp1
-rw-r--r--library/qpestyle.cpp3
-rw-r--r--library/qpetoolbar.cpp2
-rw-r--r--library/qt_override.cpp2
-rw-r--r--library/resource.cpp3
-rw-r--r--library/sound.cpp2
-rw-r--r--library/storage.cpp4
-rw-r--r--library/tzselect.cpp1
28 files changed, 1 insertions, 74 deletions
diff --git a/library/alarmserver.cpp b/library/alarmserver.cpp
index 6f6f32d..48ab9c1 100644
--- a/library/alarmserver.cpp
+++ b/library/alarmserver.cpp
@@ -1,77 +1,72 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include <qdir.h> 21#include <qdir.h>
22#include <qfile.h>
23#include <qmessagebox.h>
24#include <qtextstream.h>
25 22
26 23
27#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
28#include "global.h"
29#include "resource.h"
30 25
31#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
32#include "alarmserver.h" 27#include "alarmserver.h"
33#include <qpe/timeconversion.h> 28#include <qpe/timeconversion.h>
34 29
35#include <sys/types.h> 30#include <sys/types.h>
36#include <sys/stat.h> 31#include <sys/stat.h>
37 32
38#include <stdlib.h> 33#include <stdlib.h>
39#include <unistd.h> 34#include <unistd.h>
40 35
41 36
42#undef USE_ATD // not used anymore -- we run opie-alarm on suspend/resume 37#undef USE_ATD // not used anymore -- we run opie-alarm on suspend/resume
43 38
44 39
45struct timerEventItem 40struct timerEventItem
46{ 41{
47 time_t UTCtime; 42 time_t UTCtime;
48 QCString channel, message; 43 QCString channel, message;
49 int data; 44 int data;
50 bool operator==( const timerEventItem &right ) const 45 bool operator==( const timerEventItem &right ) const
51 { 46 {
52 return ( UTCtime == right.UTCtime 47 return ( UTCtime == right.UTCtime
53 && channel == right.channel 48 && channel == right.channel
54 && message == right.message 49 && message == right.message
55 && data == right.data ); 50 && data == right.data );
56 } 51 }
57}; 52};
58 53
59class TimerReceiverObject : public QObject 54class TimerReceiverObject : public QObject
60{ 55{
61public: 56public:
62 TimerReceiverObject() 57 TimerReceiverObject()
63 { } 58 { }
64 ~TimerReceiverObject() 59 ~TimerReceiverObject()
65 { } 60 { }
66 void resetTimer(); 61 void resetTimer();
67 void setTimerEventItem(); 62 void setTimerEventItem();
68 void deleteTimer(); 63 void deleteTimer();
69protected: 64protected:
70 void timerEvent( QTimerEvent *te ); 65 void timerEvent( QTimerEvent *te );
71 66
72#ifdef USE_ATD 67#ifdef USE_ATD
73private: 68private:
74 QString atfilename; 69 QString atfilename;
75#endif 70#endif
76}; 71};
77 72
diff --git a/library/applnk.cpp b/library/applnk.cpp
index 8763eb2..9c60f1a 100644
--- a/library/applnk.cpp
+++ b/library/applnk.cpp
@@ -1,89 +1,85 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#define QTOPIA_INTERNAL_MIMEEXT 21#define QTOPIA_INTERNAL_MIMEEXT
22#define QTOPIA_INTERNAL_PRELOADACCESS 22#define QTOPIA_INTERNAL_PRELOADACCESS
23#define QTOPIA_INTERNAL_APPLNKASSIGN 23#define QTOPIA_INTERNAL_APPLNKASSIGN
24 24
25#include "applnk.h" 25#include "applnk.h"
26 26
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/categories.h> 28#include <qpe/categories.h>
29#include <qpe/categoryselect.h> 29#include <qpe/categoryselect.h>
30#include <qpe/qcopenvelope_qws.h> 30#include <qpe/qcopenvelope_qws.h>
31#include <qpe/global.h>
32#include <qpe/mimetype.h> 31#include <qpe/mimetype.h>
33#include <qpe/config.h> 32#include <qpe/config.h>
34#include <qpe/storage.h> 33#include <qpe/storage.h>
35#include <qpe/resource.h> 34#include <qpe/resource.h>
36 35
37#include <qdict.h>
38#include <qdir.h> 36#include <qdir.h>
39#include <qregexp.h>
40 37
41#include <qgfx_qws.h>
42 38
43#include <stdlib.h> 39#include <stdlib.h>
44 40
45int AppLnk::lastId = 5000; 41int AppLnk::lastId = 5000;
46 42
47static int smallSize = 14; 43static int smallSize = 14;
48static int bigSize = 32; 44static int bigSize = 32;
49 45
50static QString safeFileName(const QString& n) 46static QString safeFileName(const QString& n)
51{ 47{
52 QString safename=n; 48 QString safename=n;
53 safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); 49 safename.replace(QRegExp("[^0-9A-Za-z.]"),"_");
54 safename.replace(QRegExp("^[^A-Za-z]*"),""); 50 safename.replace(QRegExp("^[^A-Za-z]*"),"");
55 if ( safename.isEmpty() ) 51 if ( safename.isEmpty() )
56 safename = "_"; 52 safename = "_";
57 return safename; 53 return safename;
58} 54}
59 55
60static bool prepareDirectories(const QString& lf) 56static bool prepareDirectories(const QString& lf)
61{ 57{
62 if ( !QFile::exists(lf) ) { 58 if ( !QFile::exists(lf) ) {
63 // May need to create directories 59 // May need to create directories
64 QFileInfo fi(lf); 60 QFileInfo fi(lf);
65 if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) 61 if ( system(("mkdir -p "+fi.dirPath(TRUE))) )
66 return FALSE; 62 return FALSE;
67 } 63 }
68 return TRUE; 64 return TRUE;
69} 65}
70 66
71class AppLnkPrivate 67class AppLnkPrivate
72{ 68{
73public: 69public:
74 /* the size of the Pixmap */ 70 /* the size of the Pixmap */
75 enum Size {Normal = 0, Big }; 71 enum Size {Normal = 0, Big };
76 AppLnkPrivate() { 72 AppLnkPrivate() {
77 /* we want one normal and one big item */ 73 /* we want one normal and one big item */
78 74
79 QPixmap pix; 75 QPixmap pix;
80 mPixmaps.insert(0, pix ); 76 mPixmaps.insert(0, pix );
81 mPixmaps.insert(1, pix); 77 mPixmaps.insert(1, pix);
82 } 78 }
83 79
84 QStringList mCatList; // always correct 80 QStringList mCatList; // always correct
85 QArray<int> mCat; // cached value; correct if not empty 81 QArray<int> mCat; // cached value; correct if not empty
86 QMap<int, QPixmap> mPixmaps; 82 QMap<int, QPixmap> mPixmaps;
87 83
88 void updateCatListFromArray() 84 void updateCatListFromArray()
89 { 85 {
diff --git a/library/categoryedit_p.cpp b/library/categoryedit_p.cpp
index 9321259..14ac2e1 100644
--- a/library/categoryedit_p.cpp
+++ b/library/categoryedit_p.cpp
@@ -1,78 +1,75 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "categoryedit_p.h" 21#include "categoryedit_p.h"
22 22
23#include <qpe/categories.h> 23#include <qpe/categories.h>
24 24
25#include <qdir.h> 25#include <qdir.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qlistview.h>
29#include <qstringlist.h>
30#include <qtoolbutton.h>
31 28
32#include <sys/types.h> 29#include <sys/types.h>
33#include <sys/stat.h> 30#include <sys/stat.h>
34 31
35#include <stdlib.h> 32#include <stdlib.h>
36 33
37 34
38using namespace Qtopia; 35using namespace Qtopia;
39 36
40class CategoryEditPrivate 37class CategoryEditPrivate
41{ 38{
42public: 39public:
43 CategoryEditPrivate( QWidget *parent, const QString &appName ) 40 CategoryEditPrivate( QWidget *parent, const QString &appName )
44 : mCategories( parent, "" ), 41 : mCategories( parent, "" ),
45 mStrApp( appName ) 42 mStrApp( appName )
46 { 43 {
47 editItem = 0; 44 editItem = 0;
48 mCategories.load( categoryFileName() ); 45 mCategories.load( categoryFileName() );
49 } 46 }
50 Categories mCategories; 47 Categories mCategories;
51 QListViewItem *editItem; 48 QListViewItem *editItem;
52 QString mStrApp; 49 QString mStrApp;
53 QString mVisible; 50 QString mVisible;
54}; 51};
55 52
56CategoryEdit::CategoryEdit( QWidget *parent, const char *name ) 53CategoryEdit::CategoryEdit( QWidget *parent, const char *name )
57 : CategoryEditBase( parent, name ) 54 : CategoryEditBase( parent, name )
58{ 55{
59 d = 0; 56 d = 0;
60} 57}
61 58
62CategoryEdit::CategoryEdit( const QArray<int> &recCats, 59CategoryEdit::CategoryEdit( const QArray<int> &recCats,
63 const QString &appName, const QString &visibleName, 60 const QString &appName, const QString &visibleName,
64 QWidget *parent, const char *name ) 61 QWidget *parent, const char *name )
65 : CategoryEditBase( parent, name ) 62 : CategoryEditBase( parent, name )
66{ 63{
67 d = 0; 64 d = 0;
68 setCategories( recCats, appName, visibleName ); 65 setCategories( recCats, appName, visibleName );
69} 66}
70 67
71void CategoryEdit::setCategories( const QArray<int> &recCats, 68void CategoryEdit::setCategories( const QArray<int> &recCats,
72 const QString &appName, const QString &visibleName ) 69 const QString &appName, const QString &visibleName )
73{ 70{
74 if ( !d ) 71 if ( !d )
75 d = new CategoryEditPrivate( (QWidget*)parent(), name() ); 72 d = new CategoryEditPrivate( (QWidget*)parent(), name() );
76 d->mStrApp = appName; 73 d->mStrApp = appName;
77 d->mVisible = visibleName; 74 d->mVisible = visibleName;
78 75
diff --git a/library/categorymenu.cpp b/library/categorymenu.cpp
index 5d7adf7..9bbb448 100644
--- a/library/categorymenu.cpp
+++ b/library/categorymenu.cpp
@@ -1,73 +1,71 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "categorymenu.h" 21#include "categorymenu.h"
22#include "backend/categories.h" 22#include "backend/categories.h"
23#include "categoryselect.h" 23#include "categoryselect.h"
24#include <qstring.h>
25#include <qmap.h>
26 24
27/*! 25/*!
28 \class CategoryMenu 26 \class CategoryMenu
29 \brief The CategoryMenu widget aids in filtering records or files by Category. 27 \brief The CategoryMenu widget aids in filtering records or files by Category.
30 28
31 The CategoryMenu widget provides a popup menu that will make filtering records 29 The CategoryMenu widget provides a popup menu that will make filtering records
32 or files by category much easier. The widget will lookup the available 30 or files by category much easier. The widget will lookup the available
33 categories for an application, populate the menu, and keep a track of which 31 categories for an application, populate the menu, and keep a track of which
34 categories are being filtered against. A set of categories can be tested 32 categories are being filtered against. A set of categories can be tested
35 by the isSelected() function to see if a record or file containing those 33 by the isSelected() function to see if a record or file containing those
36 categories would be allowed through by the filter. 34 categories would be allowed through by the filter.
37 35
38 \warning Currently this class is not suitable for extending. 36 \warning Currently this class is not suitable for extending.
39 37
40 \ingroup qtopiaemb 38 \ingroup qtopiaemb
41*/ 39*/
42 40
43/*! 41/*!
44 \fn void CategoryMenu::categoryChange() 42 \fn void CategoryMenu::categoryChange()
45 This signal is emitted when the user selects a different category in the 43 This signal is emitted when the user selects a different category in the
46 menu, hence changing what records or files should be selected. 44 menu, hence changing what records or files should be selected.
47*/ 45*/
48 46
49/*! 47/*!
50 Creates a new CategoryMenu with \a parent and \a name. The menu will be 48 Creates a new CategoryMenu with \a parent and \a name. The menu will be
51 populated with the available categories for \a application. 49 populated with the available categories for \a application.
52 50
53 If \a globals is TRUE then it will also poplulate the menu with the 51 If \a globals is TRUE then it will also poplulate the menu with the
54 global categories. 52 global categories.
55*/ 53*/
56CategoryMenu::CategoryMenu( const QString &n, bool ig = TRUE, 54CategoryMenu::CategoryMenu( const QString &n, bool ig = TRUE,
57 QWidget *parent, const char *name ) : 55 QWidget *parent, const char *name ) :
58 QPopupMenu(parent, name), 56 QPopupMenu(parent, name),
59 appName(n), 57 appName(n),
60 includeGlobal(ig) 58 includeGlobal(ig)
61{ 59{
62 currentMid = 1; 60 currentMid = 1;
63 reload(); 61 reload();
64 connect(this, SIGNAL(activated(int)), this, SLOT(mapMenuId(int))); 62 connect(this, SIGNAL(activated(int)), this, SLOT(mapMenuId(int)));
65} 63}
66 64
67/*! 65/*!
68 Destroys a CategoryMenu. 66 Destroys a CategoryMenu.
69*/ 67*/
70CategoryMenu::~CategoryMenu( ) 68CategoryMenu::~CategoryMenu( )
71{ 69{
72} 70}
73 71
diff --git a/library/config.cpp b/library/config.cpp
index b28c771..8b60f60 100644
--- a/library/config.cpp
+++ b/library/config.cpp
@@ -1,71 +1,69 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include <qdir.h> 21#include <qdir.h>
22#include <qfile.h>
23#include <qfileinfo.h>
24#include <qmessagebox.h> 22#include <qmessagebox.h>
25#if QT_VERSION <= 230 && defined(QT_NO_CODECS) 23#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
26#include <qtextcodec.h> 24#include <qtextcodec.h>
27#endif 25#endif
28#include <qtextstream.h> 26#include <qtextstream.h>
29 27
30#include <sys/stat.h> 28#include <sys/stat.h>
31#include <sys/types.h> 29#include <sys/types.h>
32#include <fcntl.h> 30#include <fcntl.h>
33#include <stdlib.h> 31#include <stdlib.h>
34#include <unistd.h> 32#include <unistd.h>
35 33
36#define QTOPIA_INTERNAL_LANGLIST 34#define QTOPIA_INTERNAL_LANGLIST
37#include "config.h" 35#include "config.h"
38#include "global.h" 36#include "global.h"
39 37
40 38
41/*! 39/*!
42 \internal 40 \internal
43*/ 41*/
44QString Config::configFilename(const QString& name, Domain d) 42QString Config::configFilename(const QString& name, Domain d)
45{ 43{
46 switch (d) { 44 switch (d) {
47 case File: 45 case File:
48 return name; 46 return name;
49 case User: { 47 case User: {
50 QDir dir = (QString(getenv("HOME")) + "/Settings"); 48 QDir dir = (QString(getenv("HOME")) + "/Settings");
51 if ( !dir.exists() ) 49 if ( !dir.exists() )
52 mkdir(dir.path().local8Bit(),0700); 50 mkdir(dir.path().local8Bit(),0700);
53 return dir.path() + "/" + name + ".conf"; 51 return dir.path() + "/" + name + ".conf";
54 } 52 }
55 } 53 }
56 return name; 54 return name;
57} 55}
58 56
59/*! 57/*!
60 \class Config config.h 58 \class Config config.h
61 \brief The Config class provides for saving application cofniguration state. 59 \brief The Config class provides for saving application cofniguration state.
62 60
63 You should keep a Config in existence only while you do not want others 61 You should keep a Config in existence only while you do not want others
64 to be able to change the state. There is no locking currently, but there 62 to be able to change the state. There is no locking currently, but there
65 may be in the future. 63 may be in the future.
66*/ 64*/
67 65
68/*! 66/*!
69 \enum Config::ConfigGroup 67 \enum Config::ConfigGroup
70 \internal 68 \internal
71*/ 69*/
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp
index 188d8e1..e4ec2bf 100644
--- a/library/datebookdb.cpp
+++ b/library/datebookdb.cpp
@@ -1,81 +1,76 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include <qasciidict.h> 21#include <qasciidict.h>
22#include <qfile.h>
23#include <qmessagebox.h> 22#include <qmessagebox.h>
24#include <qstring.h>
25#include <qtextcodec.h>
26#include <qtextstream.h>
27#include <qtl.h> 23#include <qtl.h>
28 24
29#include <qpe/alarmserver.h> 25#include <qpe/alarmserver.h>
30#include <qpe/global.h> 26#include <qpe/global.h>
31#include "datebookdb.h" 27#include "datebookdb.h"
32#include <qpe/stringutil.h> 28#include <qpe/stringutil.h>
33#include <qpe/timeconversion.h>
34 29
35#include <errno.h> 30#include <errno.h>
36#include <stdlib.h> 31#include <stdlib.h>
37 32
38 33
39class DateBookDBPrivate 34class DateBookDBPrivate
40{ 35{
41public: 36public:
42 bool clean; // indcate whether we need to write to disk... 37 bool clean; // indcate whether we need to write to disk...
43}; 38};
44 39
45 40
46// Helper functions 41// Helper functions
47 42
48static QString dateBookJournalFile() 43static QString dateBookJournalFile()
49{ 44{
50 QString str = getenv("HOME"); 45 QString str = getenv("HOME");
51 return QString( str +"/.caljournal" ); 46 return QString( str +"/.caljournal" );
52} 47}
53 48
54static QString dateBookFilename() 49static QString dateBookFilename()
55{ 50{
56 return Global::applicationFileName("datebook","datebook.xml"); 51 return Global::applicationFileName("datebook","datebook.xml");
57} 52}
58 53
59/* Calculating the next event of a recuring event is actually 54/* Calculating the next event of a recuring event is actually
60 computationally inexpensive, esp. compared to checking each day 55 computationally inexpensive, esp. compared to checking each day
61 individually. There are bad worse cases for say the 29th of 56 individually. There are bad worse cases for say the 29th of
62 february or the 31st of some other months. However 57 february or the 31st of some other months. However
63 these are still bounded */ 58 these are still bounded */
64bool nextOccurance(const Event &e, const QDate &from, QDateTime &next) 59bool nextOccurance(const Event &e, const QDate &from, QDateTime &next)
65{ 60{
66 // easy checks, first are we too far in the future or too far in the past? 61 // easy checks, first are we too far in the future or too far in the past?
67 QDate tmpDate; 62 QDate tmpDate;
68 int freq = e.repeatPattern().frequency; 63 int freq = e.repeatPattern().frequency;
69 int diff, diff2, a; 64 int diff, diff2, a;
70 int iday, imonth, iyear; 65 int iday, imonth, iyear;
71 int dayOfWeek = 0; 66 int dayOfWeek = 0;
72 int firstOfWeek = 0; 67 int firstOfWeek = 0;
73 int weekOfMonth; 68 int weekOfMonth;
74 69
75 70
76 if (e.repeatPattern().hasEndDate && e.repeatPattern().endDate() < from) 71 if (e.repeatPattern().hasEndDate && e.repeatPattern().endDate() < from)
77 return FALSE; 72 return FALSE;
78 73
79 if (e.start() >= from) { 74 if (e.start() >= from) {
80 next = e.start(); 75 next = e.start();
81 return TRUE; 76 return TRUE;
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 728045f..76e022f 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -1,81 +1,76 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 "config.h" 20#include "config.h"
21#include "datebookmonth.h" 21#include "datebookmonth.h"
22#include "datebookdb.h" 22#include "datebookdb.h"
23#include <qtopia/private/event.h>
24#include "resource.h" 23#include "resource.h"
25#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
26#include "timestring.h"
27 25
28#include <qtoolbutton.h> 26#include <qtoolbutton.h>
29#include <qspinbox.h> 27#include <qspinbox.h>
30#include <qcombobox.h> 28#include <qcombobox.h>
31#include <qdatetime.h>
32#include <qpainter.h>
33#include <qpopupmenu.h>
34#include <qvaluestack.h> 29#include <qvaluestack.h>
35#include <qwhatsthis.h> 30#include <qwhatsthis.h>
36 31
37 32
38DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name ) 33DateBookMonthHeader::DateBookMonthHeader( QWidget *parent, const char *name )
39 : QHBox( parent, name ) 34 : QHBox( parent, name )
40{ 35{
41 setBackgroundMode( PaletteButton ); 36 setBackgroundMode( PaletteButton );
42 37
43 begin = new QToolButton( this ); 38 begin = new QToolButton( this );
44 begin->setFocusPolicy(NoFocus); 39 begin->setFocusPolicy(NoFocus);
45 begin->setPixmap( Resource::loadPixmap( "start" ) ); 40 begin->setPixmap( Resource::loadPixmap( "start" ) );
46 begin->setAutoRaise( TRUE ); 41 begin->setAutoRaise( TRUE );
47 begin->setFixedSize( begin->sizeHint() ); 42 begin->setFixedSize( begin->sizeHint() );
48 QWhatsThis::add( begin, tr("Show January in the selected year") ); 43 QWhatsThis::add( begin, tr("Show January in the selected year") );
49 44
50 back = new QToolButton( this ); 45 back = new QToolButton( this );
51 back->setFocusPolicy(NoFocus); 46 back->setFocusPolicy(NoFocus);
52 back->setPixmap( Resource::loadPixmap( "back" ) ); 47 back->setPixmap( Resource::loadPixmap( "back" ) );
53 back->setAutoRaise( TRUE ); 48 back->setAutoRaise( TRUE );
54 back->setFixedSize( back->sizeHint() ); 49 back->setFixedSize( back->sizeHint() );
55 QWhatsThis::add( back, tr("Show the previous month") ); 50 QWhatsThis::add( back, tr("Show the previous month") );
56 51
57 month = new QComboBox( FALSE, this ); 52 month = new QComboBox( FALSE, this );
58 for ( int i = 0; i < 12; ++i ) 53 for ( int i = 0; i < 12; ++i )
59 month->insertItem( Calendar::nameOfMonth( i + 1 ) ); 54 month->insertItem( Calendar::nameOfMonth( i + 1 ) );
60 55
61 year = new QSpinBox( 1752, 8000, 1, this ); 56 year = new QSpinBox( 1752, 8000, 1, this );
62 57
63 next = new QToolButton( this ); 58 next = new QToolButton( this );
64 next->setFocusPolicy(NoFocus); 59 next->setFocusPolicy(NoFocus);
65 next->setPixmap( Resource::loadPixmap( "forward" ) ); 60 next->setPixmap( Resource::loadPixmap( "forward" ) );
66 next->setAutoRaise( TRUE ); 61 next->setAutoRaise( TRUE );
67 next->setFixedSize( next->sizeHint() ); 62 next->setFixedSize( next->sizeHint() );
68 QWhatsThis::add( next, tr("Show the next month") ); 63 QWhatsThis::add( next, tr("Show the next month") );
69 64
70 end = new QToolButton( this ); 65 end = new QToolButton( this );
71 end->setFocusPolicy(NoFocus); 66 end->setFocusPolicy(NoFocus);
72 end->setPixmap( Resource::loadPixmap( "finish" ) ); 67 end->setPixmap( Resource::loadPixmap( "finish" ) );
73 end->setAutoRaise( TRUE ); 68 end->setAutoRaise( TRUE );
74 end->setFixedSize( end->sizeHint() ); 69 end->setFixedSize( end->sizeHint() );
75 QWhatsThis::add( end, tr("Show December in the selected year") ); 70 QWhatsThis::add( end, tr("Show December in the selected year") );
76 71
77 connect( month, SIGNAL( activated( int ) ), 72 connect( month, SIGNAL( activated( int ) ),
78 this, SLOT( updateDate() ) ); 73 this, SLOT( updateDate() ) );
79 connect( year, SIGNAL( valueChanged( int ) ), 74 connect( year, SIGNAL( valueChanged( int ) ),
80 this, SLOT( updateDate() ) ); 75 this, SLOT( updateDate() ) );
81 connect( begin, SIGNAL( clicked() ), 76 connect( begin, SIGNAL( clicked() ),
diff --git a/library/filemanager.cpp b/library/filemanager.cpp
index 408be20..1e7384e 100644
--- a/library/filemanager.cpp
+++ b/library/filemanager.cpp
@@ -1,75 +1,72 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 "filemanager.h" 20#include "filemanager.h"
21#include "applnk.h" 21#include "applnk.h"
22 22
23#include <qdir.h>
24#include <qfile.h>
25#include <qfileinfo.h> 23#include <qfileinfo.h>
26#include <qtextstream.h> 24#include <qtextstream.h>
27#include <qtextcodec.h>
28 25
29#include <errno.h> 26#include <errno.h>
30#include <stdlib.h> 27#include <stdlib.h>
31#include <unistd.h> 28#include <unistd.h>
32#include <sys/stat.h> 29#include <sys/stat.h>
33#include <dirent.h> 30#include <dirent.h>
34#ifdef Q_OS_MACX 31#ifdef Q_OS_MACX
35// MacOS X does not have sendfile.. :( 32// MacOS X does not have sendfile.. :(
36// But maybe in the future.. !? 33// But maybe in the future.. !?
37# ifdef SENDFILE 34# ifdef SENDFILE
38# include <sys/types.h> 35# include <sys/types.h>
39# include <sys/socket.h> 36# include <sys/socket.h>
40# endif 37# endif
41#else 38#else
42# include <sys/sendfile.h> 39# include <sys/sendfile.h>
43#endif /* Q_OS_MACX */ 40#endif /* Q_OS_MACX */
44#include <fcntl.h> 41#include <fcntl.h>
45 42
46/*! 43/*!
47 \class FileManager 44 \class FileManager
48 \brief The FileManager class assists with AppLnk input/output. 45 \brief The FileManager class assists with AppLnk input/output.
49*/ 46*/
50 47
51/*! 48/*!
52 Constructs a FileManager. 49 Constructs a FileManager.
53*/ 50*/
54FileManager::FileManager() 51FileManager::FileManager()
55{ 52{
56} 53}
57 54
58/*! 55/*!
59 Destroys a FileManager. 56 Destroys a FileManager.
60*/ 57*/
61FileManager::~FileManager() 58FileManager::~FileManager()
62{ 59{
63 60
64} 61}
65 62
66/*! 63/*!
67 Saves \a data as the document specified by \a f. 64 Saves \a data as the document specified by \a f.
68 65
69 Returns whether the operation succeeded. 66 Returns whether the operation succeeded.
70*/ 67*/
71bool FileManager::saveFile( const DocLnk &f, const QByteArray &data ) 68bool FileManager::saveFile( const DocLnk &f, const QByteArray &data )
72{ 69{
73 QString fn = f.file() + ".new"; 70 QString fn = f.file() + ".new";
74 ensurePathExists( fn ); 71 ensurePathExists( fn );
75 QFile fl( fn ); 72 QFile fl( fn );
diff --git a/library/fileselector.cpp b/library/fileselector.cpp
index 4039243..7c29aba 100644
--- a/library/fileselector.cpp
+++ b/library/fileselector.cpp
@@ -1,83 +1,81 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FSLP 23#define QTOPIA_INTERNAL_FSLP
24 24
25#include "fileselector.h" 25#include "fileselector.h"
26#include "fileselector_p.h" 26#include "fileselector_p.h"
27#include "global.h" 27#include "global.h"
28#include "resource.h" 28#include "resource.h"
29#include "config.h" 29#include "config.h"
30#include "applnk.h"
31#include "storage.h" 30#include "storage.h"
32#include "qpemenubar.h" 31#include "qpemenubar.h"
33#include <qcopchannel_qws.h> 32#include <qcopchannel_qws.h>
34#include "lnkproperties.h" 33#include "lnkproperties.h"
35#include "applnk.h"
36#include <qpe/qpeapplication.h> 34#include <qpe/qpeapplication.h>
37#include "categorymenu.h" 35#include "categorymenu.h"
38#include "categoryselect.h" 36#include "categoryselect.h"
39#include "mimetype.h" 37#include "mimetype.h"
40#include <qpe/categories.h> 38#include <qpe/categories.h>
41 39
42#include <stdlib.h> 40#include <stdlib.h>
43 41
44#include <qdir.h> 42#include <qdir.h>
45#include <qwidget.h> 43#include <qwidget.h>
46#include <qpopupmenu.h> 44#include <qpopupmenu.h>
47#include <qtoolbutton.h> 45#include <qtoolbutton.h>
48#include <qpushbutton.h> 46#include <qpushbutton.h>
49#include <qheader.h> 47#include <qheader.h>
50#include <qtooltip.h> 48#include <qtooltip.h>
51#include <qwhatsthis.h> 49#include <qwhatsthis.h>
52 50
53class TypeCombo : public QComboBox 51class TypeCombo : public QComboBox
54{ 52{
55 Q_OBJECT 53 Q_OBJECT
56public: 54public:
57 TypeCombo( QWidget *parent, const char *name=0 ) 55 TypeCombo( QWidget *parent, const char *name=0 )
58 : QComboBox( parent, name ) 56 : QComboBox( parent, name )
59 { 57 {
60 connect( this, SIGNAL(activated(int)), this, SLOT(selectType(int)) ); 58 connect( this, SIGNAL(activated(int)), this, SLOT(selectType(int)) );
61 } 59 }
62 60
63 void reread( DocLnkSet &files, const QString &filter ); 61 void reread( DocLnkSet &files, const QString &filter );
64 62
65signals: 63signals:
66 void selected( const QString & ); 64 void selected( const QString & );
67 65
68protected slots: 66protected slots:
69 void selectType( int idx ) { 67 void selectType( int idx ) {
70 emit selected( typelist[idx] ); 68 emit selected( typelist[idx] );
71 } 69 }
72 70
73protected: 71protected:
74 QStringList typelist; 72 QStringList typelist;
75 QString prev; 73 QString prev;
76}; 74};
77 75
78void TypeCombo::reread( DocLnkSet &files, const QString &filter ) 76void TypeCombo::reread( DocLnkSet &files, const QString &filter )
79{ 77{
80 typelist.clear(); 78 typelist.clear();
81 QStringList filters = QStringList::split( ';', filter ); 79 QStringList filters = QStringList::split( ';', filter );
82 int pos = filter.find( '/' ); 80 int pos = filter.find( '/' );
83 //### do for each filter 81 //### do for each filter
diff --git a/library/finddialog.cpp b/library/finddialog.cpp
index ddf41a7..64487c9 100644
--- a/library/finddialog.cpp
+++ b/library/finddialog.cpp
@@ -1,77 +1,76 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FD 23#define QTOPIA_INTERNAL_FD
24 24
25#include "finddialog.h" 25#include "finddialog.h"
26#include "findwidget_p.h" 26#include "findwidget_p.h"
27 27
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qpushbutton.h>
30 29
31/*! 30/*!
32 \class FindDialog finddialog.h 31 \class FindDialog finddialog.h
33 \brief A simple FindDialog 32 \brief A simple FindDialog
34 33
35 A find dialog. FIXME!!!! 34 A find dialog. FIXME!!!!
36 35
37*/ 36*/
38FindDialog::FindDialog( const QString &appName, QWidget *parent, 37FindDialog::FindDialog( const QString &appName, QWidget *parent,
39 const char *name, bool modal ) 38 const char *name, bool modal )
40 : QDialog( parent, name, modal ) 39 : QDialog( parent, name, modal )
41{ 40{
42 setCaption( tr("Find") ); 41 setCaption( tr("Find") );
43 QVBoxLayout *vb; 42 QVBoxLayout *vb;
44 vb = new QVBoxLayout( this ); 43 vb = new QVBoxLayout( this );
45 fw = new FindWidget( appName, this, "Find Widget" ); 44 fw = new FindWidget( appName, this, "Find Widget" );
46 vb->addWidget( fw ); 45 vb->addWidget( fw );
47 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&, 46 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,
48 bool,bool,int)), 47 bool,bool,int)),
49 this, SIGNAL(signalFindClicked(const QString&, 48 this, SIGNAL(signalFindClicked(const QString&,
50 bool,bool,int)) ); 49 bool,bool,int)) );
51 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,const QDate&, 50 QObject::connect( fw, SIGNAL(signalFindClicked(const QString&,const QDate&,
52 bool,bool,int)), 51 bool,bool,int)),
53 this, SIGNAL(signalFindClicked(const QString&, 52 this, SIGNAL(signalFindClicked(const QString&,
54 const QDate&,bool,bool,int)) ); 53 const QDate&,bool,bool,int)) );
55 d = 0; 54 d = 0;
56} 55}
57 56
58FindDialog::~FindDialog() 57FindDialog::~FindDialog()
59{ 58{
60} 59}
61 60
62QString FindDialog::findText() const 61QString FindDialog::findText() const
63{ 62{
64 return fw->findText(); 63 return fw->findText();
65} 64}
66 65
67void FindDialog::setUseDate( bool show ) 66void FindDialog::setUseDate( bool show )
68{ 67{
69 fw->setUseDate( show ); 68 fw->setUseDate( show );
70} 69}
71 70
72void FindDialog::setDate( const QDate &dt ) 71void FindDialog::setDate( const QDate &dt )
73{ 72{
74 fw->setDate( dt ); 73 fw->setDate( dt );
75} 74}
76 75
77void FindDialog::slotNotFound() 76void FindDialog::slotNotFound()
diff --git a/library/findwidget_p.cpp b/library/findwidget_p.cpp
index 287e125..e91d789 100644
--- a/library/findwidget_p.cpp
+++ b/library/findwidget_p.cpp
@@ -1,82 +1,76 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "findwidget_p.h" 21#include "findwidget_p.h"
22 22
23#include <qpe/categories.h>
24#include <qpe/categoryselect.h> 23#include <qpe/categoryselect.h>
25#include <qpe/datebookmonth.h> 24#include <qpe/datebookmonth.h>
26#include <qpe/timestring.h>
27 25
28#include <qcheckbox.h> 26#include <qcheckbox.h>
29#include <qlabel.h> 27#include <qlabel.h>
30#include <qlineedit.h> 28#include <qlineedit.h>
31#include <qmessagebox.h>
32#include <qpushbutton.h>
33#include <qpopupmenu.h>
34#include <qtoolbutton.h>
35 29
36FindWidget::FindWidget( const QString &appName, QWidget *parent, 30FindWidget::FindWidget( const QString &appName, QWidget *parent,
37 const char *name ) 31 const char *name )
38 : FindWidgetBase( parent, name ), 32 : FindWidgetBase( parent, name ),
39 mStrApp( appName ), 33 mStrApp( appName ),
40 mDate( QDate::currentDate() ) 34 mDate( QDate::currentDate() )
41{ 35{
42 setMaximumSize( sizeHint() ); 36 setMaximumSize( sizeHint() );
43 QArray<int> vl(0); 37 QArray<int> vl(0);
44 cmbCat->setCategories( vl, mStrApp ); 38 cmbCat->setCategories( vl, mStrApp );
45 cmbCat->setRemoveCategoryEdit( TRUE ); 39 cmbCat->setRemoveCategoryEdit( TRUE );
46 cmbCat->setAllCategories( TRUE ); 40 cmbCat->setAllCategories( TRUE );
47 // hide junk for the moment... 41 // hide junk for the moment...
48 lblStartDate->hide(); 42 lblStartDate->hide();
49 cmdStartDate->hide(); 43 cmdStartDate->hide();
50 QPopupMenu *m1 = new QPopupMenu( this ); 44 QPopupMenu *m1 = new QPopupMenu( this );
51 dtPicker = new DateBookMonth( m1, 0, TRUE ); 45 dtPicker = new DateBookMonth( m1, 0, TRUE );
52 dtPicker->setDate( mDate.year(), mDate.month(), mDate.day() ); 46 dtPicker->setDate( mDate.year(), mDate.month(), mDate.day() );
53 m1->insertItem( dtPicker ); 47 m1->insertItem( dtPicker );
54 cmdStartDate->setPopup( m1 ); 48 cmdStartDate->setPopup( m1 );
55 cmdStartDate->setText( TimeString::shortDate(mDate) ); 49 cmdStartDate->setText( TimeString::shortDate(mDate) );
56 QObject::connect( dtPicker, SIGNAL(dateClicked(int, int, int)), 50 QObject::connect( dtPicker, SIGNAL(dateClicked(int, int, int)),
57 this, SLOT(slotDateChanged(int, int, int)) ); 51 this, SLOT(slotDateChanged(int, int, int)) );
58 52
59 QObject::connect( cmdFind, SIGNAL(clicked()), 53 QObject::connect( cmdFind, SIGNAL(clicked()),
60 this, SLOT(slotFindClicked()) ); 54 this, SLOT(slotFindClicked()) );
61} 55}
62 56
63FindWidget::~FindWidget() 57FindWidget::~FindWidget()
64{ 58{
65} 59}
66 60
67QString FindWidget::findText() const 61QString FindWidget::findText() const
68{ 62{
69 return txtFind->text(); 63 return txtFind->text();
70} 64}
71 65
72void FindWidget::slotFindClicked() 66void FindWidget::slotFindClicked()
73{ 67{
74 lblStatus->setText( "" ); 68 lblStatus->setText( "" );
75 if ( cmdStartDate->isVisible() ) 69 if ( cmdStartDate->isVisible() )
76 emit signalFindClicked( findText(), 70 emit signalFindClicked( findText(),
77 mDate, 71 mDate,
78 chkCase->isChecked(), 72 chkCase->isChecked(),
79 chkBackwards->isChecked(), 73 chkBackwards->isChecked(),
80 cmbCat->currentCategory() ); 74 cmbCat->currentCategory() );
81 else 75 else
82 emit signalFindClicked( findText(), chkCase->isChecked(), 76 emit signalFindClicked( findText(), chkCase->isChecked(),
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index 2ad8e95..d94e338 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -1,77 +1,75 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22#include "fontfactoryinterface.h"
23#include "fontdatabase.h" 22#include "fontdatabase.h"
24 23
25#include <qpe/qlibrary.h> 24#include <qpe/qlibrary.h>
26 25
27#include <qfontmanager_qws.h> 26#include <qfontmanager_qws.h>
28#include <qdir.h> 27#include <qdir.h>
29#include <qdict.h>
30#include <stdio.h> 28#include <stdio.h>
31#include <stdlib.h> 29#include <stdlib.h>
32 30
33static QString fontDir() 31static QString fontDir()
34{ 32{
35 QString qtdir = getenv("QTDIR"); 33 QString qtdir = getenv("QTDIR");
36 if ( qtdir.isEmpty() ) qtdir = "/usr/local/qt-embedded"; 34 if ( qtdir.isEmpty() ) qtdir = "/usr/local/qt-embedded";
37 return qtdir+"/lib/fonts/"; 35 return qtdir+"/lib/fonts/";
38} 36}
39 37
40#ifdef QT_NO_FONTDATABASE 38#ifdef QT_NO_FONTDATABASE
41static QString fontFamily( const QString& key ) 39static QString fontFamily( const QString& key )
42{ 40{
43 int u0 = key.find('_'); 41 int u0 = key.find('_');
44 int u1 = key.find('_',u0+1); 42 int u1 = key.find('_',u0+1);
45 int u2 = key.find('_',u1+1); 43 int u2 = key.find('_',u1+1);
46 QString family = key.left(u0); 44 QString family = key.left(u0);
47 //int pointSize = key.mid(u0+1,u1-u0-1).toInt(); 45 //int pointSize = key.mid(u0+1,u1-u0-1).toInt();
48 //int weight = key.mid(u1+1,u2-u1-1).toInt(); 46 //int weight = key.mid(u1+1,u2-u1-1).toInt();
49 //bool italic = key.mid(u2-1,1) == "i"; 47 //bool italic = key.mid(u2-1,1) == "i";
50 // #### ignores _t and _I fields 48 // #### ignores _t and _I fields
51 return family; 49 return family;
52} 50}
53#endif 51#endif
54 52
55 53
56QValueList<FontFactory> *FontDatabase::factoryList = 0; 54QValueList<FontFactory> *FontDatabase::factoryList = 0;
57/*! 55/*!
58 \class FontDatabase fontdatabase.h 56 \class FontDatabase fontdatabase.h
59 \brief The FontDatabase class provides information about available fonts. 57 \brief The FontDatabase class provides information about available fonts.
60 58
61 Most often you will simply want to query the database for the 59 Most often you will simply want to query the database for the
62 available font families(). 60 available font families().
63 61
64 Use FontDatabase rather than QFontDatabase when you may need access 62 Use FontDatabase rather than QFontDatabase when you may need access
65 to fonts that are not normally available. For example, if the 63 to fonts that are not normally available. For example, if the
66 freetype library and the Qtopia freetype plugin are installed, 64 freetype library and the Qtopia freetype plugin are installed,
67 TrueType fonts will be available to your application. Font renderer 65 TrueType fonts will be available to your application. Font renderer
68 plugins have greater resource requirements than system fonts so they 66 plugins have greater resource requirements than system fonts so they
69 should be used only when necessary. You can force the loading of 67 should be used only when necessary. You can force the loading of
70 font renderer plugins with loadRenderers(). 68 font renderer plugins with loadRenderers().
71 69
72 \ingroup qtopiaemb 70 \ingroup qtopiaemb
73*/ 71*/
74 72
75/*! 73/*!
76 Constructs a FontDatabase object. 74 Constructs a FontDatabase object.
77*/ 75*/
diff --git a/library/global.cpp b/library/global.cpp
index a627348..5ac969b 100644
--- a/library/global.cpp
+++ b/library/global.cpp
@@ -1,99 +1,97 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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#define QTOPIA_INTERNAL_LANGLIST 20#define QTOPIA_INTERNAL_LANGLIST
21#include <qpe/qpedebug.h> 21#include <qpe/qpedebug.h>
22#include <qpe/global.h> 22#include <qpe/global.h>
23#include <qpe/qdawg.h> 23#include <qpe/qdawg.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/storage.h> 26#include <qpe/storage.h>
27#include <qpe/applnk.h> 27#include <qpe/applnk.h>
28#include <qpe/qcopenvelope_qws.h> 28#include <qpe/qcopenvelope_qws.h>
29#include <qpe/config.h> 29#include <qpe/config.h>
30 30
31#include <qfile.h>
32#include <qlabel.h> 31#include <qlabel.h>
33#include <qtimer.h> 32#include <qtimer.h>
34#include <qmap.h> 33#include <qmap.h>
35#include <qdict.h> 34#include <qdict.h>
36#include <qdir.h> 35#include <qdir.h>
37#include <qmessagebox.h> 36#include <qmessagebox.h>
38#include <qregexp.h> 37#include <qregexp.h>
39 38
40#include <stdlib.h> 39#include <stdlib.h>
41#include <sys/stat.h> 40#include <sys/stat.h>
42#include <sys/wait.h> 41#include <sys/wait.h>
43#include <sys/types.h> 42#include <sys/types.h>
44#include <fcntl.h> 43#include <fcntl.h>
45#include <unistd.h> 44#include <unistd.h>
46#include <errno.h> 45#include <errno.h>
47 46
48#include <qwindowsystem_qws.h> // for qwsServer 47#include <qwindowsystem_qws.h> // for qwsServer
49#include <qdatetime.h> 48#include <qdatetime.h>
50 49
51#include <qfile.h>
52 50
53//#include "quickexec_p.h" 51//#include "quickexec_p.h"
54 52
55class Emitter : public QObject { 53class Emitter : public QObject {
56 Q_OBJECT 54 Q_OBJECT
57public: 55public:
58 Emitter( QWidget* receiver, const QString& document ) 56 Emitter( QWidget* receiver, const QString& document )
59 { 57 {
60 connect(this, SIGNAL(setDocument(const QString&)), 58 connect(this, SIGNAL(setDocument(const QString&)),
61 receiver, SLOT(setDocument(const QString&))); 59 receiver, SLOT(setDocument(const QString&)));
62 emit setDocument(document); 60 emit setDocument(document);
63 disconnect(this, SIGNAL(setDocument(const QString&)), 61 disconnect(this, SIGNAL(setDocument(const QString&)),
64 receiver, SLOT(setDocument(const QString&))); 62 receiver, SLOT(setDocument(const QString&)));
65 } 63 }
66 64
67signals: 65signals:
68 void setDocument(const QString&); 66 void setDocument(const QString&);
69}; 67};
70 68
71 69
72class StartingAppList : public QObject { 70class StartingAppList : public QObject {
73 Q_OBJECT 71 Q_OBJECT
74public: 72public:
75 static void add( const QString& name ); 73 static void add( const QString& name );
76 static bool isStarting( const QString name ); 74 static bool isStarting( const QString name );
77private slots: 75private slots:
78 void handleNewChannel( const QString &); 76 void handleNewChannel( const QString &);
79private: 77private:
80 StartingAppList( QObject *parent=0, const char* name=0 ) ; 78 StartingAppList( QObject *parent=0, const char* name=0 ) ;
81 79
82 QDict<QTime> dict; 80 QDict<QTime> dict;
83 static StartingAppList *appl; 81 static StartingAppList *appl;
84}; 82};
85 83
86StartingAppList* StartingAppList::appl = 0; 84StartingAppList* StartingAppList::appl = 0;
87 85
88StartingAppList::StartingAppList( QObject *parent, const char* name ) 86StartingAppList::StartingAppList( QObject *parent, const char* name )
89 :QObject( parent, name ) 87 :QObject( parent, name )
90{ 88{
91#if QT_VERSION >= 232 && defined(QWS) 89#if QT_VERSION >= 232 && defined(QWS)
92 connect( qwsServer, SIGNAL( newChannel(const QString&)), 90 connect( qwsServer, SIGNAL( newChannel(const QString&)),
93 this, SLOT( handleNewChannel(const QString&)) ); 91 this, SLOT( handleNewChannel(const QString&)) );
94#endif 92#endif
95 dict.setAutoDelete( TRUE ); 93 dict.setAutoDelete( TRUE );
96} 94}
97 95
98void StartingAppList::add( const QString& name ) 96void StartingAppList::add( const QString& name )
99{ 97{
diff --git a/library/imageedit.cpp b/library/imageedit.cpp
index caa538a..3a559f4 100644
--- a/library/imageedit.cpp
+++ b/library/imageedit.cpp
@@ -1,69 +1,68 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 "imageedit.h" 20#include "imageedit.h"
21#include <qpainter.h>
22 21
23ImageEdit::ImageEdit( QWidget *parent, const char *name) 22ImageEdit::ImageEdit( QWidget *parent, const char *name)
24 : QScrollView( parent, name, WNorthWestGravity | WResizeNoErase ), buffer() 23 : QScrollView( parent, name, WNorthWestGravity | WResizeNoErase ), buffer()
25{ 24{
26 buffer.resize( size() ); 25 buffer.resize( size() );
27 buffer.fill( colorGroup().color( QColorGroup::Base ) ); 26 buffer.fill( colorGroup().color( QColorGroup::Base ) );
28} 27}
29 28
30ImageEdit::~ImageEdit() 29ImageEdit::~ImageEdit()
31{ 30{
32 31
33} 32}
34 33
35void ImageEdit::contentsMousePressEvent( QMouseEvent *e ) 34void ImageEdit::contentsMousePressEvent( QMouseEvent *e )
36{ 35{
37 lastPos = e->pos(); 36 lastPos = e->pos();
38} 37}
39 38
40void ImageEdit::contentsMouseMoveEvent( QMouseEvent *e ) 39void ImageEdit::contentsMouseMoveEvent( QMouseEvent *e )
41{ 40{
42 QPainter pw( viewport() ); 41 QPainter pw( viewport() );
43 QPainter pb( &buffer ); 42 QPainter pb( &buffer );
44 pb.drawLine( lastPos, e->pos() ); 43 pb.drawLine( lastPos, e->pos() );
45 pw.drawLine( contentsToViewport( lastPos ), 44 pw.drawLine( contentsToViewport( lastPos ),
46 contentsToViewport( e->pos() ) ); 45 contentsToViewport( e->pos() ) );
47 lastPos = e->pos(); 46 lastPos = e->pos();
48} 47}
49 48
50void ImageEdit::contentsMouseReleaseEvent( QMouseEvent * ) 49void ImageEdit::contentsMouseReleaseEvent( QMouseEvent * )
51{ 50{
52} 51}
53 52
54void ImageEdit::viewportResizeEvent( QResizeEvent *e ) 53void ImageEdit::viewportResizeEvent( QResizeEvent *e )
55{ 54{
56 enlargeBuffer(e->size()); 55 enlargeBuffer(e->size());
57} 56}
58 57
59void ImageEdit::enlargeBuffer( const QSize& sz ) 58void ImageEdit::enlargeBuffer( const QSize& sz )
60{ 59{
61 QSize osz = buffer.size(); 60 QSize osz = buffer.size();
62 QSize nsz( QMAX( osz.width(), sz.width() ), QMAX( osz.height(), sz.height() ) ); 61 QSize nsz( QMAX( osz.width(), sz.width() ), QMAX( osz.height(), sz.height() ) );
63 buffer.resize( nsz.width(), nsz.height() ); 62 buffer.resize( nsz.width(), nsz.height() );
64 // clear new area 63 // clear new area
65 QPainter p( &buffer ); 64 QPainter p( &buffer );
66 if ( sz.width() > osz.width() ) 65 if ( sz.width() > osz.width() )
67 p.fillRect( osz.width(), 0, sz.width() - osz.width(), nsz.height(), colorGroup().color( QColorGroup::Base ) ); 66 p.fillRect( osz.width(), 0, sz.width() - osz.width(), nsz.height(), colorGroup().color( QColorGroup::Base ) );
68 if ( sz.height() > osz.height() ) 67 if ( sz.height() > osz.height() )
69 p.fillRect( 0, osz.height(), nsz.width(), sz.height() - osz.height(), colorGroup().color( QColorGroup::Base ) ); 68 p.fillRect( 0, osz.height(), nsz.width(), sz.height() - osz.height(), colorGroup().color( QColorGroup::Base ) );
diff --git a/library/ir.cpp b/library/ir.cpp
index b5b726d..32c0925 100644
--- a/library/ir.cpp
+++ b/library/ir.cpp
@@ -1,73 +1,71 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "ir.h" 21#include "ir.h"
22 22
23#include <qstring.h>
24#include "qcopenvelope_qws.h" 23#include "qcopenvelope_qws.h"
25#include <qcopchannel_qws.h>
26#include "applnk.h" 24#include "applnk.h"
27 25
28/*! 26/*!
29 \class Ir ir.h 27 \class Ir ir.h
30 \brief The Ir class implements basic support for sending objects over an 28 \brief The Ir class implements basic support for sending objects over an
31 infrared communication link. 29 infrared communication link.
32 30
33 Both \link doclnk.html DocLnk\endlink objects and files can be 31 Both \link doclnk.html DocLnk\endlink objects and files can be
34 sent to another device via the infrared link using the send() 32 sent to another device via the infrared link using the send()
35 function. When the send has completed the done() signal is 33 function. When the send has completed the done() signal is
36 emitted. 34 emitted.
37 35
38 The supported() function returns whether the device supports 36 The supported() function returns whether the device supports
39 infrared communication or not. 37 infrared communication or not.
40 38
41 \ingroup qtopiaemb 39 \ingroup qtopiaemb
42*/ 40*/
43 41
44/*! 42/*!
45 Constructs an Ir object. The \a parent and \a name classes are the 43 Constructs an Ir object. The \a parent and \a name classes are the
46 standard QObject parameters. 44 standard QObject parameters.
47*/ 45*/
48Ir::Ir( QObject *parent, const char *name ) 46Ir::Ir( QObject *parent, const char *name )
49 : QObject( parent, name ) 47 : QObject( parent, name )
50{ 48{
51#ifndef QT_NO_COP 49#ifndef QT_NO_COP
52 ch = new QCopChannel( "QPE/Obex" ); 50 ch = new QCopChannel( "QPE/Obex" );
53 connect( ch, SIGNAL(received(const QCString &, const QByteArray &)), 51 connect( ch, SIGNAL(received(const QCString &, const QByteArray &)),
54 this, SLOT(obexMessage( const QCString &, const QByteArray &)) ); 52 this, SLOT(obexMessage( const QCString &, const QByteArray &)) );
55#endif 53#endif
56} 54}
57 55
58/*! 56/*!
59 Returns TRUE if the system supports infrared communication; 57 Returns TRUE if the system supports infrared communication;
60 otherwise returns FALSE. 58 otherwise returns FALSE.
61*/ 59*/
62bool Ir::supported() 60bool Ir::supported()
63{ 61{
64#ifndef QT_NO_COP 62#ifndef QT_NO_COP
65 return QCopChannel::isRegistered( "QPE/Obex" ); 63 return QCopChannel::isRegistered( "QPE/Obex" );
66#endif 64#endif
67} 65}
68 66
69/*! 67/*!
70 Sends the object in file \a fn over the infrared link. The \a 68 Sends the object in file \a fn over the infrared link. The \a
71 description is used in the text shown to the user while sending 69 description is used in the text shown to the user while sending
72 is in progress. The optional \a mimetype parameter specifies the 70 is in progress. The optional \a mimetype parameter specifies the
73 mimetype of the object. If this parameter is not set, it is 71 mimetype of the object. If this parameter is not set, it is
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 8dca4ab..0661423 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -1,74 +1,73 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FSLP 23#define QTOPIA_INTERNAL_FSLP
24#include "lnkproperties.h"
25#include "lnkproperties.h"
26#include "lnkpropertiesbase_p.h" 24#include "lnkpropertiesbase_p.h"
25#include "lnkproperties.h"
27#include "ir.h" 26#include "ir.h"
28 27
29#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
30#include <qpe/applnk.h> 29#include <qpe/applnk.h>
31#include <qpe/global.h> 30#include <qpe/global.h>
32#include <qpe/categorywidget.h> 31#include <qpe/categorywidget.h>
33#include <qpe/qcopenvelope_qws.h> 32#include <qpe/qcopenvelope_qws.h>
34#include <qpe/filemanager.h> 33#include <qpe/filemanager.h>
35#include <qpe/config.h> 34#include <qpe/config.h>
36#include <qpe/storage.h> 35#include <qpe/storage.h>
37#include <qpe/qpemessagebox.h> 36#include <qpe/qpemessagebox.h>
38#include <qpe/mimetype.h> 37#include <qpe/mimetype.h>
39 38
40#include <qlineedit.h> 39#include <qlineedit.h>
41#include <qtoolbutton.h> 40#include <qtoolbutton.h>
42#include <qpushbutton.h> 41#include <qpushbutton.h>
43#include <qgroupbox.h> 42#include <qgroupbox.h>
44#include <qcheckbox.h> 43#include <qcheckbox.h>
45#include <qlabel.h> 44#include <qlabel.h>
46#include <qlayout.h> 45#include <qlayout.h>
47#include <qfile.h> 46#include <qfile.h>
48#include <qfileinfo.h> 47#include <qfileinfo.h>
49#include <qmessagebox.h> 48#include <qmessagebox.h>
50#include <qsize.h> 49#include <qsize.h>
51#include <qcombobox.h> 50#include <qcombobox.h>
52#include <qregexp.h> 51#include <qregexp.h>
53#include <qbuttongroup.h> 52#include <qbuttongroup.h>
54 53
55#include <stdlib.h> 54#include <stdlib.h>
56 55
57LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) 56LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
58 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 ) 57 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
59{ 58{
60 setCaption( tr("Properties") ); 59 setCaption( tr("Properties") );
61 60
62 QVBoxLayout *vbox = new QVBoxLayout( this ); 61 QVBoxLayout *vbox = new QVBoxLayout( this );
63 d = new LnkPropertiesBase( this ); 62 d = new LnkPropertiesBase( this );
64 vbox->add( d ); 63 vbox->add( d );
65 64
66 // hide custom rotation feature for now, need a new implementation to fit quicklauch, 65 // hide custom rotation feature for now, need a new implementation to fit quicklauch,
67 // is confusing for the user and doubtable useful since life rotation 66 // is confusing for the user and doubtable useful since life rotation
68 d->rotate->hide(); 67 d->rotate->hide();
69 d->rotateButtons->hide(); 68 d->rotateButtons->hide();
70 69
71 d->docname->setText(l->name()); 70 d->docname->setText(l->name());
72 QString inf; 71 QString inf;
73 if ( l->type().isEmpty() ) { 72 if ( l->type().isEmpty() ) {
74 d->type->hide(); 73 d->type->hide();
diff --git a/library/mimetype.cpp b/library/mimetype.cpp
index d0a578e..23de70b 100644
--- a/library/mimetype.cpp
+++ b/library/mimetype.cpp
@@ -1,81 +1,77 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#define QTOPIA_INTERNAL_MIMEEXT 21#define QTOPIA_INTERNAL_MIMEEXT
22#include "mimetype.h" 22#include "mimetype.h"
23#include "applnk.h" 23#include "applnk.h"
24#include "resource.h" 24#include "resource.h"
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include "config.h" 26#include "config.h"
27 27
28#include <qfile.h> 28#include <qfile.h>
29#include <qdict.h>
30#include <qregexp.h>
31#include <qstringlist.h>
32#include <qtextstream.h> 29#include <qtextstream.h>
33#include <qmap.h>
34 30
35 31
36static void cleanupMime() 32static void cleanupMime()
37{ 33{
38 MimeType::clear(); 34 MimeType::clear();
39} 35}
40 36
41class MimeTypeData { 37class MimeTypeData {
42public: 38public:
43 MimeTypeData(const QString& i) : 39 MimeTypeData(const QString& i) :
44 id(i) 40 id(i)
45 { 41 {
46 apps.setAutoDelete(TRUE); 42 apps.setAutoDelete(TRUE);
47 } 43 }
48 QString id; 44 QString id;
49 QString extension; 45 QString extension;
50 QList<AppLnk> apps; 46 QList<AppLnk> apps;
51 47
52 QString description() 48 QString description()
53 { 49 {
54 if ( desc.isEmpty() ) 50 if ( desc.isEmpty() )
55 desc = QPEApplication::tr("%1 document").arg(apps.first()->name()); 51 desc = QPEApplication::tr("%1 document").arg(apps.first()->name());
56 return desc; 52 return desc;
57 } 53 }
58 54
59 QPixmap regIcon() 55 QPixmap regIcon()
60 { 56 {
61 if ( regicon.isNull() ) 57 if ( regicon.isNull() )
62 loadPixmaps(); 58 loadPixmaps();
63 return regicon; 59 return regicon;
64 } 60 }
65 61
66 QPixmap bigIcon() 62 QPixmap bigIcon()
67 { 63 {
68 if ( bigicon.isNull() ) 64 if ( bigicon.isNull() )
69 loadPixmaps(); 65 loadPixmaps();
70 return bigicon; 66 return bigicon;
71 } 67 }
72 68
73private: 69private:
74 void loadPixmaps() 70 void loadPixmaps()
75 { 71 {
76 if ( apps.count() ) { 72 if ( apps.count() ) {
77 QString icon; 73 QString icon;
78 for (AppLnk* lnk = apps.first(); icon.isNull() && lnk; lnk=apps.next()) { 74 for (AppLnk* lnk = apps.first(); icon.isNull() && lnk; lnk=apps.next()) {
79 QStringList icons = lnk->mimeTypeIcons(); 75 QStringList icons = lnk->mimeTypeIcons();
80 if ( icons.count() ) { 76 if ( icons.count() ) {
81 QStringList types = lnk->mimeTypes(); 77 QStringList types = lnk->mimeTypes();
diff --git a/library/qcopenvelope_qws.cpp b/library/qcopenvelope_qws.cpp
index 0aac32b..8f58787 100644
--- a/library/qcopenvelope_qws.cpp
+++ b/library/qcopenvelope_qws.cpp
@@ -1,74 +1,72 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#ifndef QT_NO_COP 21#ifndef QT_NO_COP
22#include "qcopenvelope_qws.h" 22#include "qcopenvelope_qws.h"
23#endif 23#endif
24#include "global.h"
25#include <qbuffer.h> 24#include <qbuffer.h>
26#include <qdatastream.h>
27#include <qfile.h> 25#include <qfile.h>
28#include <unistd.h> 26#include <unistd.h>
29#include <errno.h> 27#include <errno.h>
30#include <sys/file.h> 28#include <sys/file.h>
31#include <sys/types.h> 29#include <sys/types.h>
32#include <sys/stat.h> 30#include <sys/stat.h>
33#include <time.h> 31#include <time.h>
34 32
35#ifndef QT_NO_COP 33#ifndef QT_NO_COP
36 34
37/*! 35/*!
38 \class QCopEnvelope qcopenvelope_qws.h 36 \class QCopEnvelope qcopenvelope_qws.h
39 \brief The QCopEnvelope class encapsulates and sends QCop messages 37 \brief The QCopEnvelope class encapsulates and sends QCop messages
40 over QCopChannels. 38 over QCopChannels.
41 39
42 QCop messages allow applications to communicate with each other. 40 QCop messages allow applications to communicate with each other.
43 These messages are sent using QCopEnvelope, and received by connecting 41 These messages are sent using QCopEnvelope, and received by connecting
44 to a QCopChannel. 42 to a QCopChannel.
45 43
46 To send a message, use the following protocol: 44 To send a message, use the following protocol:
47 45
48 \code 46 \code
49 QCopEnvelope e(channelname, messagename); 47 QCopEnvelope e(channelname, messagename);
50 e << parameter1 << parameter2 << ...; 48 e << parameter1 << parameter2 << ...;
51 \endcode 49 \endcode
52 50
53 For messages without parameters, simply use: 51 For messages without parameters, simply use:
54 52
55 \code 53 \code
56 QCopEnvelope e(channelname, messagename); 54 QCopEnvelope e(channelname, messagename);
57 \endcode 55 \endcode
58 56
59 (Do not try to simplify this further as it may confuse some 57 (Do not try to simplify this further as it may confuse some
60 compilers.) 58 compilers.)
61 59
62 The \c{channelname} of channels within Qtopia all start with "QPE/". 60 The \c{channelname} of channels within Qtopia all start with "QPE/".
63 The \c{messagename} is a function identifier followed by a list of types 61 The \c{messagename} is a function identifier followed by a list of types
64 in parentheses. There is no whitespace in the message name. 62 in parentheses. There is no whitespace in the message name.
65 63
66 To receive a message, you will generally just use your application's 64 To receive a message, you will generally just use your application's
67 predefined QPE/Application/\e{appname} channel 65 predefined QPE/Application/\e{appname} channel
68 (see QPEApplication::appMessage()), but you can make another channel 66 (see QPEApplication::appMessage()), but you can make another channel
69 and connect it to a slot like this: 67 and connect it to a slot like this:
70 68
71 \code 69 \code
72 myChannel = new QCopChannel( "QPE/FooBar", this ); 70 myChannel = new QCopChannel( "QPE/FooBar", this );
73 connect( myChannel, SIGNAL(received(const QCString &, const QByteArray &)), 71 connect( myChannel, SIGNAL(received(const QCString &, const QByteArray &)),
74 this, SLOT(fooBarMessage( const QCString &, const QByteArray &)) ); 72 this, SLOT(fooBarMessage( const QCString &, const QByteArray &)) );
diff --git a/library/qdawg.cpp b/library/qdawg.cpp
index af5dc82..2ea5734 100644
--- a/library/qdawg.cpp
+++ b/library/qdawg.cpp
@@ -1,71 +1,69 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 "qdawg.h" 20#include "qdawg.h"
21#include <qintdict.h> 21#include <qintdict.h>
22#include <qvaluelist.h>
23#include <qtextstream.h>
24#include <qfile.h> 22#include <qfile.h>
25#include <qtl.h> 23#include <qtl.h>
26 24
27#include <limits.h> 25#include <limits.h>
28#include <stdio.h> 26#include <stdio.h>
29 27
30// for mmap 28// for mmap
31#include <sys/types.h> 29#include <sys/types.h>
32#include <sys/stat.h> 30#include <sys/stat.h>
33#include <sys/mman.h> 31#include <sys/mman.h>
34#include <fcntl.h> 32#include <fcntl.h>
35#include <errno.h> 33#include <errno.h>
36#include <unistd.h> 34#include <unistd.h>
37 35
38class QDawgPrivate; 36class QDawgPrivate;
39class QTrie; 37class QTrie;
40 38
41typedef QValueList<QTrie*> TrieClub; 39typedef QValueList<QTrie*> TrieClub;
42typedef QIntDict<TrieClub> TrieClubDirectory; 40typedef QIntDict<TrieClub> TrieClubDirectory;
43 41
44class TriePtr { 42class TriePtr {
45public: 43public:
46 QChar letter; 44 QChar letter;
47 QTrie* p; 45 QTrie* p;
48 int operator <(const TriePtr& o) const; 46 int operator <(const TriePtr& o) const;
49 int operator >(const TriePtr& o) const; 47 int operator >(const TriePtr& o) const;
50 int operator <=(const TriePtr& o) const; 48 int operator <=(const TriePtr& o) const;
51}; 49};
52 50
53class TrieList : public QValueList<TriePtr> { 51class TrieList : public QValueList<TriePtr> {
54 bool sorted; 52 bool sorted;
55public: 53public:
56 TrieList() 54 TrieList()
57 { 55 {
58 sorted=TRUE; 56 sorted=TRUE;
59 } 57 }
60 58
61 QTrie* findAdd(QChar c); 59 QTrie* findAdd(QChar c);
62 bool equal(TrieList& l); 60 bool equal(TrieList& l);
63 61
64 void sort() 62 void sort()
65 { 63 {
66 if ( !sorted ) { 64 if ( !sorted ) {
67 qHeapSort(*this); 65 qHeapSort(*this);
68 sorted = TRUE; 66 sorted = TRUE;
69 } 67 }
70 } 68 }
71}; 69};
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index c7ef2b7..262221e 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -1057,97 +1057,96 @@ static int deforient = -1;
1057 1057
1058/*! 1058/*!
1059 \internal 1059 \internal
1060*/ 1060*/
1061int QPEApplication::defaultRotation() 1061int QPEApplication::defaultRotation()
1062{ 1062{
1063 if ( deforient < 0 ) { 1063 if ( deforient < 0 ) {
1064 QString d = getenv( "QWS_DISPLAY" ); 1064 QString d = getenv( "QWS_DISPLAY" );
1065 if ( d.contains( "Rot90" ) ) { 1065 if ( d.contains( "Rot90" ) ) {
1066 deforient = 90; 1066 deforient = 90;
1067 } 1067 }
1068 else if ( d.contains( "Rot180" ) ) { 1068 else if ( d.contains( "Rot180" ) ) {
1069 deforient = 180; 1069 deforient = 180;
1070 } 1070 }
1071 else if ( d.contains( "Rot270" ) ) { 1071 else if ( d.contains( "Rot270" ) ) {
1072 deforient = 270; 1072 deforient = 270;
1073 } 1073 }
1074 else { 1074 else {
1075 deforient = 0; 1075 deforient = 0;
1076 } 1076 }
1077 } 1077 }
1078 return deforient; 1078 return deforient;
1079} 1079}
1080 1080
1081/*! 1081/*!
1082 \internal 1082 \internal
1083*/ 1083*/
1084void QPEApplication::setDefaultRotation( int r ) 1084void QPEApplication::setDefaultRotation( int r )
1085{ 1085{
1086 if ( qApp->type() == GuiServer ) { 1086 if ( qApp->type() == GuiServer ) {
1087 deforient = r; 1087 deforient = r;
1088 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); 1088 setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 );
1089 Config config("qpe"); 1089 Config config("qpe");
1090 config.setGroup( "Rotation" ); 1090 config.setGroup( "Rotation" );
1091 config.writeEntry( "Rot", r ); 1091 config.writeEntry( "Rot", r );
1092 } 1092 }
1093 else { 1093 else {
1094#ifndef QT_NO_COP 1094#ifndef QT_NO_COP
1095 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); 1095 { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" );
1096 e << r; 1096 e << r;
1097 } 1097 }
1098#endif 1098#endif
1099 1099
1100 } 1100 }
1101} 1101}
1102 1102
1103#include <qgfx_qws.h> 1103#include <qgfx_qws.h>
1104#include <qwindowsystem_qws.h> 1104#include <qwindowsystem_qws.h>
1105#include <qpixmapcache.h>
1106 1105
1107extern void qws_clearLoadedFonts(); 1106extern void qws_clearLoadedFonts();
1108 1107
1109void QPEApplication::setCurrentMode( int x, int y, int depth ) 1108void QPEApplication::setCurrentMode( int x, int y, int depth )
1110{ 1109{
1111 // Reset the caches 1110 // Reset the caches
1112 qws_clearLoadedFonts(); 1111 qws_clearLoadedFonts();
1113 QPixmapCache::clear(); 1112 QPixmapCache::clear();
1114 1113
1115 // Change the screen mode 1114 // Change the screen mode
1116 qt_screen->setMode(x, y, depth); 1115 qt_screen->setMode(x, y, depth);
1117 1116
1118 if ( qApp->type() == GuiServer ) { 1117 if ( qApp->type() == GuiServer ) {
1119 // Reconfigure the GuiServer 1118 // Reconfigure the GuiServer
1120 qwsServer->beginDisplayReconfigure(); 1119 qwsServer->beginDisplayReconfigure();
1121 qwsServer->endDisplayReconfigure(); 1120 qwsServer->endDisplayReconfigure();
1122 1121
1123 // Get all the running apps to reset 1122 // Get all the running apps to reset
1124 QCopEnvelope env( "QPE/System", "reset()" ); 1123 QCopEnvelope env( "QPE/System", "reset()" );
1125 } 1124 }
1126} 1125}
1127 1126
1128void QPEApplication::reset() { 1127void QPEApplication::reset() {
1129 // Reconnect to the screen 1128 // Reconnect to the screen
1130 qt_screen->disconnect(); 1129 qt_screen->disconnect();
1131 qt_screen->connect( QString::null ); 1130 qt_screen->connect( QString::null );
1132 1131
1133 // Redraw everything 1132 // Redraw everything
1134 applyStyle(); 1133 applyStyle();
1135} 1134}
1136 1135
1137/*! 1136/*!
1138 \internal 1137 \internal
1139*/ 1138*/
1140void QPEApplication::applyStyle() 1139void QPEApplication::applyStyle()
1141{ 1140{
1142 Config config( "qpe" ); 1141 Config config( "qpe" );
1143 config.setGroup( "Appearance" ); 1142 config.setGroup( "Appearance" );
1144 1143
1145#if QT_VERSION > 233 1144#if QT_VERSION > 233
1146#if !defined(OPIE_NO_OVERRIDE_QT) 1145#if !defined(OPIE_NO_OVERRIDE_QT)
1147 // don't block ourselves ... 1146 // don't block ourselves ...
1148 Opie::force_appearance = 0; 1147 Opie::force_appearance = 0;
1149 1148
1150 static QString appname = Opie::binaryName ( ); 1149 static QString appname = Opie::binaryName ( );
1151 1150
1152 QStringList ex = config. readListEntry ( "NoStyle", ';' ); 1151 QStringList ex = config. readListEntry ( "NoStyle", ';' );
1153 int nostyle = 0; 1152 int nostyle = 0;
diff --git a/library/qpemenubar.cpp b/library/qpemenubar.cpp
index 3e5bad5..1d8eff4 100644
--- a/library/qpemenubar.cpp
+++ b/library/qpemenubar.cpp
@@ -1,73 +1,72 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#define INCLUDE_MENUITEM_DEF 21#define INCLUDE_MENUITEM_DEF
22 22
23#include "qpemenubar.h" 23#include "qpemenubar.h"
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qguardedptr.h>
26#include <qtimer.h> 25#include <qtimer.h>
27 26
28 27
29class QMenuBarHack : public QMenuBar 28class QMenuBarHack : public QMenuBar
30{ 29{
31public: 30public:
32 int activeItem() const { return actItem; } 31 int activeItem() const { return actItem; }
33 32
34 void goodbye() 33 void goodbye()
35 { 34 {
36 activateItemAt(-1); 35 activateItemAt(-1);
37 for ( unsigned int i = 0; i < count(); i++ ) { 36 for ( unsigned int i = 0; i < count(); i++ ) {
38 QMenuItem *mi = findItem( idAt(i) ); 37 QMenuItem *mi = findItem( idAt(i) );
39 if ( mi->popup() ) { 38 if ( mi->popup() ) {
40 mi->popup()->hide(); 39 mi->popup()->hide();
41 } 40 }
42 } 41 }
43 } 42 }
44}; 43};
45 44
46 45
47// Sharp ROM compatibility 46// Sharp ROM compatibility
48void QPEMenuToolFocusManager::setMenukeyEnabled ( bool ) 47void QPEMenuToolFocusManager::setMenukeyEnabled ( bool )
49{ 48{
50} 49}
51int QPEMenuBar::getOldFocus ( ) 50int QPEMenuBar::getOldFocus ( )
52{ 51{
53 return 0; 52 return 0;
54} 53}
55 54
56QPEMenuToolFocusManager *QPEMenuToolFocusManager::me = 0; 55QPEMenuToolFocusManager *QPEMenuToolFocusManager::me = 0;
57 56
58QPEMenuToolFocusManager::QPEMenuToolFocusManager() : QObject() 57QPEMenuToolFocusManager::QPEMenuToolFocusManager() : QObject()
59{ 58{
60 qApp->installEventFilter( this ); 59 qApp->installEventFilter( this );
61} 60}
62 61
63void QPEMenuToolFocusManager::addWidget( QWidget *w ) 62void QPEMenuToolFocusManager::addWidget( QWidget *w )
64{ 63{
65 list.append( GuardedWidget(w) ); 64 list.append( GuardedWidget(w) );
66} 65}
67 66
68void QPEMenuToolFocusManager::removeWidget( QWidget *w ) 67void QPEMenuToolFocusManager::removeWidget( QWidget *w )
69{ 68{
70 list.remove( GuardedWidget(w) ); 69 list.remove( GuardedWidget(w) );
71} 70}
72 71
73void QPEMenuToolFocusManager::setActive( bool a ) 72void QPEMenuToolFocusManager::setActive( bool a )
diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp
index 665910c..b61ada4 100644
--- a/library/qpestyle.cpp
+++ b/library/qpestyle.cpp
@@ -1,73 +1,70 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "qpestyle.h" 21#include "qpestyle.h"
22#include <qpe/qpeapplication.h>
23#include <qpushbutton.h>
24 22
25#include <qpainter.h>
26 23
27#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) 24#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
28 25
29#if QT_VERSION >= 300 26#if QT_VERSION >= 300
30 27
31#include <qdrawutil.h> 28#include <qdrawutil.h>
32#include <qcombobox.h> 29#include <qcombobox.h>
33#include <qtabbar.h> 30#include <qtabbar.h>
34 31
35QPEStyle::QPEStyle() 32QPEStyle::QPEStyle()
36{ 33{
37} 34}
38 35
39QPEStyle::~QPEStyle() 36QPEStyle::~QPEStyle()
40{ 37{
41} 38}
42 39
43void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, 40void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r,
44 const QColorGroup &cg, SFlags flags, const QStyleOption &data) const 41 const QColorGroup &cg, SFlags flags, const QStyleOption &data) const
45{ 42{
46 switch ( pe ) { 43 switch ( pe ) {
47 case PE_ButtonTool: 44 case PE_ButtonTool:
48 { 45 {
49 QColorGroup mycg = cg; 46 QColorGroup mycg = cg;
50 if ( flags & Style_On ) { 47 if ( flags & Style_On ) {
51 QBrush fill( cg.mid(), Dense4Pattern ); 48 QBrush fill( cg.mid(), Dense4Pattern );
52 mycg.setBrush( QColorGroup::Button, fill ); 49 mycg.setBrush( QColorGroup::Button, fill );
53 } 50 }
54 drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data ); 51 drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data );
55 break; 52 break;
56 } 53 }
57 case PE_ButtonCommand: 54 case PE_ButtonCommand:
58 case PE_ButtonDefault: 55 case PE_ButtonDefault:
59 case PE_ButtonBevel: 56 case PE_ButtonBevel:
60 case PE_HeaderSection: 57 case PE_HeaderSection:
61 { 58 {
62 QPen oldPen = p->pen(); 59 QPen oldPen = p->pen();
63 p->fillRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2, cg.brush(QColorGroup::Button) ); 60 p->fillRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2, cg.brush(QColorGroup::Button) );
64 61
65 int x2 = r.right(); 62 int x2 = r.right();
66 int y2 = r.bottom(); 63 int y2 = r.bottom();
67 64
68 if ( flags & (Style_Sunken | Style_Down | Style_On) ) 65 if ( flags & (Style_Sunken | Style_Down | Style_On) )
69 p->setPen( cg.dark() ); 66 p->setPen( cg.dark() );
70 else 67 else
71 p->setPen( cg.light() ); 68 p->setPen( cg.light() );
72 p->drawLine( r.x(), r.y()+1, r.x(), y2-1 ); 69 p->drawLine( r.x(), r.y()+1, r.x(), y2-1 );
73 p->drawLine( r.x()+1, r.y(), x2-1, r.y() ); 70 p->drawLine( r.x()+1, r.y(), x2-1, r.y() );
diff --git a/library/qpetoolbar.cpp b/library/qpetoolbar.cpp
index 7f95eda..bd2c9b7 100644
--- a/library/qpetoolbar.cpp
+++ b/library/qpetoolbar.cpp
@@ -1,52 +1,50 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include "qpetoolbar.h" 21#include "qpetoolbar.h"
22#include "qpemenubar.h"
23#include <qtoolbutton.h>
24 22
25/*! 23/*!
26 \class QPEToolBar qpemenubar.h 24 \class QPEToolBar qpemenubar.h
27 \brief The QPEToolBar class is obsolete. Use QToolBar instead. 25 \brief The QPEToolBar class is obsolete. Use QToolBar instead.
28 26
29 \obsolete 27 \obsolete
30 28
31 The QPEToolBar class is obsolete. Use QToolBar instead. 29 The QPEToolBar class is obsolete. Use QToolBar instead.
32 30
33 \sa QToolBar 31 \sa QToolBar
34 */ 32 */
35 33
36/*! 34/*!
37 Constructs a QPEToolBar just as you would construct 35 Constructs a QPEToolBar just as you would construct
38 a QToolBar, passing \a parent and \a name. 36 a QToolBar, passing \a parent and \a name.
39 */ 37 */
40QPEToolBar::QPEToolBar( QMainWindow *parent, const char *name ) 38QPEToolBar::QPEToolBar( QMainWindow *parent, const char *name )
41 : QToolBar( parent, name ) 39 : QToolBar( parent, name )
42{ 40{
43} 41}
44 42
45/*! 43/*!
46 \internal 44 \internal
47*/ 45*/
48void QPEToolBar::childEvent( QChildEvent *e ) 46void QPEToolBar::childEvent( QChildEvent *e )
49{ 47{
50 QToolBar::childEvent( e ); 48 QToolBar::childEvent( e );
51} 49}
52 50
diff --git a/library/qt_override.cpp b/library/qt_override.cpp
index df5a419..4d1f475 100644
--- a/library/qt_override.cpp
+++ b/library/qt_override.cpp
@@ -1,52 +1,50 @@
1 1
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qwsdecoration_qws.h>
4#include <qcommonstyle.h>
5#include <qfontdatabase.h> 3#include <qfontdatabase.h>
6 4
7#include <unistd.h> 5#include <unistd.h>
8#include <stdlib.h> 6#include <stdlib.h>
9#include <stdio.h> 7#include <stdio.h>
10#include <limits.h> 8#include <limits.h>
11#include <sys/param.h> // for toolchains with old libc headers 9#include <sys/param.h> // for toolchains with old libc headers
12 10
13#include "qt_override_p.h" 11#include "qt_override_p.h"
14 12
15#if QT_VERSION > 233 13#if QT_VERSION > 233
16 14
17struct color_fix_t { 15struct color_fix_t {
18 char *m_app; 16 char *m_app;
19 char *m_class; 17 char *m_class;
20 char *m_name; 18 char *m_name;
21 QColorGroup::ColorRole m_set; 19 QColorGroup::ColorRole m_set;
22 QColorGroup::ColorRole m_get; 20 QColorGroup::ColorRole m_get;
23}; 21};
24 22
25#ifndef OPIE_NO_OVERRIDE_QT 23#ifndef OPIE_NO_OVERRIDE_QT
26 24
27static const color_fix_t apps_that_need_special_colors [] = { 25static const color_fix_t apps_that_need_special_colors [] = {
28 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, 26 { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base },
29 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, 27 { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base },
30 28
31 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } 29 { 0, 0, 0, QColorGroup::Base, QColorGroup::Base }
32}; 30};
33 31
34static const char * const apps_that_need_pointsizes_times_10 [] = { 32static const char * const apps_that_need_pointsizes_times_10 [] = {
35 "HancomMobileWord", 33 "HancomMobileWord",
36 "hancomsheet", 34 "hancomsheet",
37 "HancomPresenterViewer", 35 "HancomPresenterViewer",
38 36
39 0 37 0
40}; 38};
41 39
42 40
43 41
44 42
45int Opie::force_appearance = 0; 43int Opie::force_appearance = 0;
46 44
47 45
48// Return the *real* name of the binary - not just a quick guess 46// Return the *real* name of the binary - not just a quick guess
49// by looking at argv [0] (which could be anything) 47// by looking at argv [0] (which could be anything)
50 48
51static void binaryNameFree ( ) 49static void binaryNameFree ( )
52{ 50{
diff --git a/library/resource.cpp b/library/resource.cpp
index f70658d..cfa0d26 100644
--- a/library/resource.cpp
+++ b/library/resource.cpp
@@ -1,77 +1,74 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#define QTOPIA_INTERNAL_MIMEEXT 21#define QTOPIA_INTERNAL_MIMEEXT
22#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
23#include "resource.h" 23#include "resource.h"
24#include "mimetype.h" 24#include "mimetype.h"
25#include <qdir.h> 25#include <qdir.h>
26#include <qfile.h>
27#include <qregexp.h>
28#include <qpixmapcache.h> 26#include <qpixmapcache.h>
29#include <qpainter.h>
30 27
31// this namespace is just a workaround for a gcc bug 28// this namespace is just a workaround for a gcc bug
32// gcc exports inline functions in the generated file 29// gcc exports inline functions in the generated file
33// inlinepics_p.h 30// inlinepics_p.h
34 31
35namespace { 32namespace {
36#include "inlinepics_p.h" 33#include "inlinepics_p.h"
37} 34}
38 35
39static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET"); 36static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET");
40 37
41/*! 38/*!
42 \class Resource resource.h 39 \class Resource resource.h
43 \brief The Resource class provides access to named resources. 40 \brief The Resource class provides access to named resources.
44 41
45 The resources may be provided from files or other sources. 42 The resources may be provided from files or other sources.
46 43
47 The allSounds() function returns a list of all the sounds available. 44 The allSounds() function returns a list of all the sounds available.
48 A particular sound can be searched for using findSound(). 45 A particular sound can be searched for using findSound().
49 46
50 Images can be loaded with loadImage(), loadPixmap(), loadBitmap() 47 Images can be loaded with loadImage(), loadPixmap(), loadBitmap()
51 and loadIconSet(). 48 and loadIconSet().
52 49
53 \ingroup qtopiaemb 50 \ingroup qtopiaemb
54*/ 51*/
55 52
56/*! 53/*!
57 \fn Resource::Resource() 54 \fn Resource::Resource()
58 \internal 55 \internal
59*/ 56*/
60 57
61/*! 58/*!
62 Returns the QPixmap called \a pix. You should avoid including 59 Returns the QPixmap called \a pix. You should avoid including
63 any filename type extension (e.g. .png, .xpm). 60 any filename type extension (e.g. .png, .xpm).
64*/ 61*/
65QPixmap Resource::loadPixmap( const QString &pix ) 62QPixmap Resource::loadPixmap( const QString &pix )
66{ 63{
67 QPixmap pm; 64 QPixmap pm;
68 QString key="QPE_"+pix; 65 QString key="QPE_"+pix;
69 if ( !QPixmapCache::find(key,pm) ) { 66 if ( !QPixmapCache::find(key,pm) ) {
70 pm.convertFromImage(loadImage(pix)); 67 pm.convertFromImage(loadImage(pix));
71 QPixmapCache::insert(key,pm); 68 QPixmapCache::insert(key,pm);
72 } 69 }
73 return pm; 70 return pm;
74} 71}
75 72
76/*! 73/*!
77 Returns the QBitmap called \a pix. You should avoid including 74 Returns the QBitmap called \a pix. You should avoid including
diff --git a/library/sound.cpp b/library/sound.cpp
index 5b67995..ee2aabc 100644
--- a/library/sound.cpp
+++ b/library/sound.cpp
@@ -1,85 +1,83 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/sound.h> 22#include <qpe/sound.h>
23#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
24 24
25#include <qsound.h> 25#include <qsound.h>
26#include <qfile.h> 26#include <qfile.h>
27 27
28#include <unistd.h> 28#include <unistd.h>
29#include <fcntl.h> 29#include <fcntl.h>
30#include <sys/ioctl.h> 30#include <sys/ioctl.h>
31 31
32#ifndef QT_NO_SOUND 32#ifndef QT_NO_SOUND
33#include <sys/soundcard.h> 33#include <sys/soundcard.h>
34#endif 34#endif
35 35
36#include "config.h"
37#include <qmessagebox.h>
38#ifndef QT_NO_SOUND 36#ifndef QT_NO_SOUND
39static int WAVsoundDuration(const QString& filename) 37static int WAVsoundDuration(const QString& filename)
40{ 38{
41 // bad solution 39 // bad solution
42 40
43 // most of this is copied from qsoundqss.cpp 41 // most of this is copied from qsoundqss.cpp
44 42
45 QFile input(filename); 43 QFile input(filename);
46 if ( !input.open(IO_ReadOnly) ) 44 if ( !input.open(IO_ReadOnly) )
47 return 0; 45 return 0;
48 46
49 struct QRiffChunk { 47 struct QRiffChunk {
50 char id[4]; 48 char id[4];
51 Q_UINT32 size; 49 Q_UINT32 size;
52 char data[4/*size*/]; 50 char data[4/*size*/];
53 } chunk; 51 } chunk;
54 52
55 struct { 53 struct {
56 Q_INT16 formatTag; 54 Q_INT16 formatTag;
57 Q_INT16 channels; 55 Q_INT16 channels;
58 Q_INT32 samplesPerSec; 56 Q_INT32 samplesPerSec;
59 Q_INT32 avgBytesPerSec; 57 Q_INT32 avgBytesPerSec;
60 Q_INT16 blockAlign; 58 Q_INT16 blockAlign;
61 Q_INT16 wBitsPerSample; 59 Q_INT16 wBitsPerSample;
62 } chunkdata; 60 } chunkdata;
63 61
64 int total = 0; 62 int total = 0;
65 63
66 while(1) { 64 while(1) {
67 // Keep reading chunks... 65 // Keep reading chunks...
68 const int n = sizeof(chunk)-sizeof(chunk.data); 66 const int n = sizeof(chunk)-sizeof(chunk.data);
69 if ( input.readBlock((char*)&chunk,n) != n ) 67 if ( input.readBlock((char*)&chunk,n) != n )
70 break; 68 break;
71 if ( qstrncmp(chunk.id,"data",4) == 0 ) { 69 if ( qstrncmp(chunk.id,"data",4) == 0 ) {
72 total += chunkdata.avgBytesPerSec ? 70 total += chunkdata.avgBytesPerSec ?
73 chunk.size * 1000 / chunkdata.avgBytesPerSec : 0; 71 chunk.size * 1000 / chunkdata.avgBytesPerSec : 0;
74//qDebug("%d bytes of PCM (%dms)", chunk.size,chunkdata.avgBytesPerSec ? chunk.size * 1000 / chunkdata.avgBytesPerSec : 0); 72//qDebug("%d bytes of PCM (%dms)", chunk.size,chunkdata.avgBytesPerSec ? chunk.size * 1000 / chunkdata.avgBytesPerSec : 0);
75 input.at(input.at()+chunk.size-4); 73 input.at(input.at()+chunk.size-4);
76 } else if ( qstrncmp(chunk.id,"RIFF",4) == 0 ) { 74 } else if ( qstrncmp(chunk.id,"RIFF",4) == 0 ) {
77 char d[4]; 75 char d[4];
78 if ( input.readBlock(d,4) != 4 ) 76 if ( input.readBlock(d,4) != 4 )
79 return 0; 77 return 0;
80 if ( qstrncmp(d,"WAVE",4) != 0 ) { 78 if ( qstrncmp(d,"WAVE",4) != 0 ) {
81 // skip 79 // skip
82//qDebug("skip %.4s RIFF chunk",d); 80//qDebug("skip %.4s RIFF chunk",d);
83 if ( chunk.size < 10000000 ) 81 if ( chunk.size < 10000000 )
84 (void)input.at(input.at()+chunk.size-4); 82 (void)input.at(input.at()+chunk.size-4);
85 } 83 }
diff --git a/library/storage.cpp b/library/storage.cpp
index d98139b..0ea465b 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -1,93 +1,89 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org> 2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org>
3** Copyright (C) Lorn Potter <llornkcor@handhelds.org> 3** Copyright (C) Lorn Potter <llornkcor@handhelds.org>
4** Copyright (C) 2000 Trolltech AS. All rights reserved. 4** Copyright (C) 2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of Opie Environment. 6** This file is part of Opie Environment.
7** 7**
8** This file may be distributed and/or modified under the terms of the 8** This file may be distributed and/or modified under the terms of the
9** GNU General Public License version 2 as published by the Free Software 9** GNU General Public License version 2 as published by the Free Software
10** Foundation and appearing in the file LICENSE.GPL included in the 10** Foundation and appearing in the file LICENSE.GPL included in the
11** packaging of this file. 11** packaging of this file.
12** 12**
13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15** 15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information. 16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17** 17**
18** Contact info@trolltech.com if any conditions of this licensing are 18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you. 19** not clear to you.
20** 20**
21**********************************************************************/ 21**********************************************************************/
22 22
23#include <qpe/storage.h> 23#include <qpe/storage.h>
24#include <qpe/custom.h>
25 24
26#include <qfile.h>
27#include <qtimer.h>
28#include <qcopchannel_qws.h> 25#include <qcopchannel_qws.h>
29 26
30#include <stdio.h> 27#include <stdio.h>
31 28
32#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 29#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
33#include <sys/vfs.h> 30#include <sys/vfs.h>
34#include <mntent.h> 31#include <mntent.h>
35#endif 32#endif
36 33
37#ifdef Q_OS_MACX 34#ifdef Q_OS_MACX
38# include <sys/param.h> 35# include <sys/param.h>
39# include <sys/ucred.h> 36# include <sys/ucred.h>
40# include <sys/mount.h> 37# include <sys/mount.h>
41# include <stdio.h> // For strerror() 38# include <stdio.h> // For strerror()
42# include <errno.h> 39# include <errno.h>
43#endif /* Q_OS_MACX */ 40#endif /* Q_OS_MACX */
44 41
45#include <qstringlist.h>
46 42
47// Shouldn't be here ! (eilers) 43// Shouldn't be here ! (eilers)
48// #include <sys/vfs.h> 44// #include <sys/vfs.h>
49// #include <mntent.h> 45// #include <mntent.h>
50 46
51 47
52static bool isCF(const QString& m) 48static bool isCF(const QString& m)
53{ 49{
54 50
55#ifndef Q_OS_MACX 51#ifndef Q_OS_MACX
56 FILE* f = fopen("/var/run/stab", "r"); 52 FILE* f = fopen("/var/run/stab", "r");
57 if (!f) f = fopen("/var/state/pcmcia/stab", "r"); 53 if (!f) f = fopen("/var/state/pcmcia/stab", "r");
58 if (!f) f = fopen("/var/lib/pcmcia/stab", "r"); 54 if (!f) f = fopen("/var/lib/pcmcia/stab", "r");
59 if ( f ) 55 if ( f )
60 { 56 {
61 char line[1024]; 57 char line[1024];
62 char devtype[80]; 58 char devtype[80];
63 char devname[80]; 59 char devname[80];
64 while ( fgets( line, 1024, f ) ) 60 while ( fgets( line, 1024, f ) )
65 { 61 {
66 // 0 ide ide-cs 0 hda 3 0 62 // 0 ide ide-cs 0 hda 3 0
67 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 ) 63 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 )
68 { 64 {
69 if ( QString(devtype) == "ide" && m.find(devname)>0 ) 65 if ( QString(devtype) == "ide" && m.find(devname)>0 )
70 { 66 {
71 fclose(f); 67 fclose(f);
72 return TRUE; 68 return TRUE;
73 } 69 }
74 } 70 }
75 } 71 }
76 fclose(f); 72 fclose(f);
77 } 73 }
78#endif /* Q_OS_MACX */ 74#endif /* Q_OS_MACX */
79 return FALSE; 75 return FALSE;
80} 76}
81 77
82/*! \class StorageInfo storage.h 78/*! \class StorageInfo storage.h
83 \brief The StorageInfo class describes the disks mounted on the file system. 79 \brief The StorageInfo class describes the disks mounted on the file system.
84 80
85 This class provides access to the mount information for the Linux 81 This class provides access to the mount information for the Linux
86 filesystem. Each mount point is represented by the FileSystem class. 82 filesystem. Each mount point is represented by the FileSystem class.
87 To ensure this class has the most up to date size information, call 83 To ensure this class has the most up to date size information, call
88 the update() method. Note that this will automatically be signaled 84 the update() method. Note that this will automatically be signaled
89 by the operating system when a disk has been mounted or unmounted. 85 by the operating system when a disk has been mounted or unmounted.
90 86
91 \ingroup qtopiaemb 87 \ingroup qtopiaemb
92*/ 88*/
93 89
diff --git a/library/tzselect.cpp b/library/tzselect.cpp
index 4343eab..f28100b 100644
--- a/library/tzselect.cpp
+++ b/library/tzselect.cpp
@@ -1,73 +1,72 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
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 20
21#define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL 21#define QTOPIA_INTERNAL_TZSELECT_INC_LOCAL
22 22
23#include "tzselect.h" 23#include "tzselect.h"
24#include "resource.h" 24#include "resource.h"
25#include "global.h"
26#include "config.h" 25#include "config.h"
27#include <qtoolbutton.h> 26#include <qtoolbutton.h>
28#include <qfile.h> 27#include <qfile.h>
29#include <stdlib.h> 28#include <stdlib.h>
30 29
31#include <qcopchannel_qws.h> 30#include <qcopchannel_qws.h>
32#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
33#include <qmessagebox.h> 32#include <qmessagebox.h>
34 33
35/*! 34/*!
36 \class TimeZoneSelector 35 \class TimeZoneSelector
37 36
38 \brief The TimeZoneSelector widget allows users to configure their time zone information. 37 \brief The TimeZoneSelector widget allows users to configure their time zone information.
39 38
40 \ingroup qtopiaemb 39 \ingroup qtopiaemb
41*/ 40*/
42 41
43class TimeZoneSelectorPrivate 42class TimeZoneSelectorPrivate
44{ 43{
45public: 44public:
46 TimeZoneSelectorPrivate() : includeLocal(FALSE) {} 45 TimeZoneSelectorPrivate() : includeLocal(FALSE) {}
47 bool includeLocal; 46 bool includeLocal;
48}; 47};
49 48
50TZCombo::TZCombo( QWidget *p, const char* n ) 49TZCombo::TZCombo( QWidget *p, const char* n )
51 : QComboBox( p, n ) 50 : QComboBox( p, n )
52{ 51{
53 updateZones(); 52 updateZones();
54 // check to see if TZ is set, if it is set the current item to that 53 // check to see if TZ is set, if it is set the current item to that
55 QString tz = getenv("TZ"); 54 QString tz = getenv("TZ");
56 if (parent()->inherits("TimeZoneSelector")) { 55 if (parent()->inherits("TimeZoneSelector")) {
57 if ( ((TimeZoneSelector *)parent())->localIncluded() ) { 56 if ( ((TimeZoneSelector *)parent())->localIncluded() ) {
58 // overide to the 'local' type. 57 // overide to the 'local' type.
59 tz = "None"; 58 tz = "None";
60 } 59 }
61 } 60 }
62 if ( !tz.isNull() ) { 61 if ( !tz.isNull() ) {
63 int n = 0, 62 int n = 0,
64 index = 0; 63 index = 0;
65 for ( QStringList::Iterator it=identifiers.begin(); 64 for ( QStringList::Iterator it=identifiers.begin();
66 it!=identifiers.end(); ++it) { 65 it!=identifiers.end(); ++it) {
67 if ( *it == tz ) 66 if ( *it == tz )
68 index = n; 67 index = n;
69 n++; 68 n++;
70 } 69 }
71 setCurrentItem(index); 70 setCurrentItem(index);
72 } else { 71 } else {
73 setCurrentItem(0); 72 setCurrentItem(0);