-rw-r--r-- | library/alarmserver.cpp | 9 | ||||
-rw-r--r-- | library/applnk.cpp | 1 | ||||
-rw-r--r-- | library/tzselect.cpp | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/library/alarmserver.cpp b/library/alarmserver.cpp index 48ab9c1..ba7b015 100644 --- a/library/alarmserver.cpp +++ b/library/alarmserver.cpp | |||
@@ -1,96 +1,95 @@ | |||
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 "alarmserver.h" |
22 | |||
23 | 22 | ||
23 | #include <qpe/global.h> | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | |||
26 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
27 | #include "alarmserver.h" | ||
28 | #include <qpe/timeconversion.h> | 26 | #include <qpe/timeconversion.h> |
29 | 27 | ||
28 | #include <qdir.h> | ||
29 | |||
30 | #include <sys/types.h> | 30 | #include <sys/types.h> |
31 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | |||
33 | #include <stdlib.h> | 32 | #include <stdlib.h> |
34 | #include <unistd.h> | 33 | #include <unistd.h> |
35 | 34 | ||
36 | 35 | ||
37 | #undef USE_ATD // not used anymore -- we run opie-alarm on suspend/resume | 36 | #undef USE_ATD // not used anymore -- we run opie-alarm on suspend/resume |
38 | 37 | ||
39 | 38 | ||
40 | struct timerEventItem | 39 | struct timerEventItem |
41 | { | 40 | { |
42 | time_t UTCtime; | 41 | time_t UTCtime; |
43 | QCString channel, message; | 42 | QCString channel, message; |
44 | int data; | 43 | int data; |
45 | bool operator==( const timerEventItem &right ) const | 44 | bool operator==( const timerEventItem &right ) const |
46 | { | 45 | { |
47 | return ( UTCtime == right.UTCtime | 46 | return ( UTCtime == right.UTCtime |
48 | && channel == right.channel | 47 | && channel == right.channel |
49 | && message == right.message | 48 | && message == right.message |
50 | && data == right.data ); | 49 | && data == right.data ); |
51 | } | 50 | } |
52 | }; | 51 | }; |
53 | 52 | ||
54 | class TimerReceiverObject : public QObject | 53 | class TimerReceiverObject : public QObject |
55 | { | 54 | { |
56 | public: | 55 | public: |
57 | TimerReceiverObject() | 56 | TimerReceiverObject() |
58 | { } | 57 | { } |
59 | ~TimerReceiverObject() | 58 | ~TimerReceiverObject() |
60 | { } | 59 | { } |
61 | void resetTimer(); | 60 | void resetTimer(); |
62 | void setTimerEventItem(); | 61 | void setTimerEventItem(); |
63 | void deleteTimer(); | 62 | void deleteTimer(); |
64 | protected: | 63 | protected: |
65 | void timerEvent( QTimerEvent *te ); | 64 | void timerEvent( QTimerEvent *te ); |
66 | 65 | ||
67 | #ifdef USE_ATD | 66 | #ifdef USE_ATD |
68 | private: | 67 | private: |
69 | QString atfilename; | 68 | QString atfilename; |
70 | #endif | 69 | #endif |
71 | }; | 70 | }; |
72 | 71 | ||
73 | TimerReceiverObject *timerEventReceiver = NULL; | 72 | TimerReceiverObject *timerEventReceiver = NULL; |
74 | QList<timerEventItem> timerEventList; | 73 | QList<timerEventItem> timerEventList; |
75 | timerEventItem *nearestTimerEvent = NULL; | 74 | timerEventItem *nearestTimerEvent = NULL; |
76 | 75 | ||
77 | 76 | ||
78 | // set the timer to go off on the next event in the list | 77 | // set the timer to go off on the next event in the list |
79 | void setNearestTimerEvent() | 78 | void setNearestTimerEvent() |
80 | { | 79 | { |
81 | nearestTimerEvent = NULL; | 80 | nearestTimerEvent = NULL; |
82 | QListIterator<timerEventItem> it( timerEventList ); | 81 | QListIterator<timerEventItem> it( timerEventList ); |
83 | if ( *it ) | 82 | if ( *it ) |
84 | nearestTimerEvent = *it; | 83 | nearestTimerEvent = *it; |
85 | for ( ; *it; ++it ) | 84 | for ( ; *it; ++it ) |
86 | if ( (*it)->UTCtime < nearestTimerEvent->UTCtime ) | 85 | if ( (*it)->UTCtime < nearestTimerEvent->UTCtime ) |
87 | nearestTimerEvent = *it; | 86 | nearestTimerEvent = *it; |
88 | if (nearestTimerEvent) | 87 | if (nearestTimerEvent) |
89 | timerEventReceiver->resetTimer(); | 88 | timerEventReceiver->resetTimer(); |
90 | else | 89 | else |
91 | timerEventReceiver->deleteTimer(); | 90 | timerEventReceiver->deleteTimer(); |
92 | } | 91 | } |
93 | 92 | ||
94 | 93 | ||
95 | //store current state to file | 94 | //store current state to file |
96 | //Simple implementation. Should run on a timer. | 95 | //Simple implementation. Should run on a timer. |
diff --git a/library/applnk.cpp b/library/applnk.cpp index e9d519e..1c1a227 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -1,93 +1,94 @@ | |||
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/global.h> | ||
30 | #include <qpe/qcopenvelope_qws.h> | 31 | #include <qpe/qcopenvelope_qws.h> |
31 | #include <qpe/mimetype.h> | 32 | #include <qpe/mimetype.h> |
32 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
33 | #include <qpe/storage.h> | 34 | #include <qpe/storage.h> |
34 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
35 | 36 | ||
36 | #include <qdir.h> | 37 | #include <qdir.h> |
37 | 38 | ||
38 | 39 | ||
39 | #include <stdlib.h> | 40 | #include <stdlib.h> |
40 | 41 | ||
41 | int AppLnk::lastId = 5000; | 42 | int AppLnk::lastId = 5000; |
42 | 43 | ||
43 | static int smallSize = 14; | 44 | static int smallSize = 14; |
44 | static int bigSize = 32; | 45 | static int bigSize = 32; |
45 | 46 | ||
46 | static QString safeFileName(const QString& n) | 47 | static QString safeFileName(const QString& n) |
47 | { | 48 | { |
48 | QString safename=n; | 49 | QString safename=n; |
49 | safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); | 50 | safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); |
50 | safename.replace(QRegExp("^[^A-Za-z]*"),""); | 51 | safename.replace(QRegExp("^[^A-Za-z]*"),""); |
51 | if ( safename.isEmpty() ) | 52 | if ( safename.isEmpty() ) |
52 | safename = "_"; | 53 | safename = "_"; |
53 | return safename; | 54 | return safename; |
54 | } | 55 | } |
55 | 56 | ||
56 | static bool prepareDirectories(const QString& lf) | 57 | static bool prepareDirectories(const QString& lf) |
57 | { | 58 | { |
58 | if ( !QFile::exists(lf) ) { | 59 | if ( !QFile::exists(lf) ) { |
59 | // May need to create directories | 60 | // May need to create directories |
60 | QFileInfo fi(lf); | 61 | QFileInfo fi(lf); |
61 | if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) | 62 | if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) |
62 | return FALSE; | 63 | return FALSE; |
63 | } | 64 | } |
64 | return TRUE; | 65 | return TRUE; |
65 | } | 66 | } |
66 | 67 | ||
67 | class AppLnkPrivate | 68 | class AppLnkPrivate |
68 | { | 69 | { |
69 | public: | 70 | public: |
70 | /* the size of the Pixmap */ | 71 | /* the size of the Pixmap */ |
71 | enum Size {Normal = 0, Big }; | 72 | enum Size {Normal = 0, Big }; |
72 | AppLnkPrivate() { | 73 | AppLnkPrivate() { |
73 | /* we want one normal and one big item */ | 74 | /* we want one normal and one big item */ |
74 | 75 | ||
75 | QPixmap pix; | 76 | QPixmap pix; |
76 | mPixmaps.insert(0, pix ); | 77 | mPixmaps.insert(0, pix ); |
77 | mPixmaps.insert(1, pix); | 78 | mPixmaps.insert(1, pix); |
78 | } | 79 | } |
79 | 80 | ||
80 | QStringList mCatList; // always correct | 81 | QStringList mCatList; // always correct |
81 | QArray<int> mCat; // cached value; correct if not empty | 82 | QArray<int> mCat; // cached value; correct if not empty |
82 | QMap<int, QPixmap> mPixmaps; | 83 | QMap<int, QPixmap> mPixmaps; |
83 | 84 | ||
84 | void updateCatListFromArray() | 85 | void updateCatListFromArray() |
85 | { | 86 | { |
86 | Categories cat( 0 ); | 87 | Categories cat( 0 ); |
87 | cat.load( categoryFileName() ); | 88 | cat.load( categoryFileName() ); |
88 | // we need to update the names for the mCat... to mCatList | 89 | // we need to update the names for the mCat... to mCatList |
89 | mCatList.clear(); | 90 | mCatList.clear(); |
90 | for (uint i = 0; i < mCat.count(); i++ ) | 91 | for (uint i = 0; i < mCat.count(); i++ ) |
91 | mCatList << cat.label("Document View", mCat[i] ); | 92 | mCatList << cat.label("Document View", mCat[i] ); |
92 | 93 | ||
93 | } | 94 | } |
diff --git a/library/tzselect.cpp b/library/tzselect.cpp index 848dfb7..8dd427f 100644 --- a/library/tzselect.cpp +++ b/library/tzselect.cpp | |||
@@ -1,94 +1,95 @@ | |||
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 "config.h" | 25 | #include "config.h" |
26 | #include <qtoolbutton.h> | 26 | #include <qtoolbutton.h> |
27 | #include <qfile.h> | 27 | #include <qfile.h> |
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | 29 | ||
30 | #include <qcopchannel_qws.h> | 30 | #include <qcopchannel_qws.h> |
31 | #include <qpe/global.h> | ||
31 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
32 | #include <qmessagebox.h> | 33 | #include <qmessagebox.h> |
33 | 34 | ||
34 | /*! | 35 | /*! |
35 | \class TimeZoneSelector | 36 | \class TimeZoneSelector |
36 | 37 | ||
37 | \brief The TimeZoneSelector widget allows users to configure their time zone information. | 38 | \brief The TimeZoneSelector widget allows users to configure their time zone information. |
38 | 39 | ||
39 | \ingroup qtopiaemb | 40 | \ingroup qtopiaemb |
40 | */ | 41 | */ |
41 | 42 | ||
42 | class TimeZoneSelectorPrivate | 43 | class TimeZoneSelectorPrivate |
43 | { | 44 | { |
44 | public: | 45 | public: |
45 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} | 46 | TimeZoneSelectorPrivate() : includeLocal(FALSE) {} |
46 | bool includeLocal; | 47 | bool includeLocal; |
47 | }; | 48 | }; |
48 | 49 | ||
49 | TZCombo::TZCombo( QWidget *p, const char* n ) | 50 | TZCombo::TZCombo( QWidget *p, const char* n ) |
50 | : QComboBox( p, n ) | 51 | : QComboBox( p, n ) |
51 | { | 52 | { |
52 | updateZones(); | 53 | updateZones(); |
53 | // check to see if TZ is set, if it is set the current item to that | 54 | // check to see if TZ is set, if it is set the current item to that |
54 | QString tz = getenv("TZ"); | 55 | QString tz = getenv("TZ"); |
55 | if (parent()->inherits("TimeZoneSelector")) { | 56 | if (parent()->inherits("TimeZoneSelector")) { |
56 | if ( ((TimeZoneSelector *)parent())->localIncluded() ) { | 57 | if ( ((TimeZoneSelector *)parent())->localIncluded() ) { |
57 | // overide to the 'local' type. | 58 | // overide to the 'local' type. |
58 | tz = "None"; | 59 | tz = "None"; |
59 | } | 60 | } |
60 | } | 61 | } |
61 | if ( !tz.isNull() ) { | 62 | if ( !tz.isNull() ) { |
62 | int n = 0, | 63 | int n = 0, |
63 | index = 0; | 64 | index = 0; |
64 | for ( QStringList::Iterator it=identifiers.begin(); | 65 | for ( QStringList::Iterator it=identifiers.begin(); |
65 | it!=identifiers.end(); ++it) { | 66 | it!=identifiers.end(); ++it) { |
66 | if ( *it == tz ) | 67 | if ( *it == tz ) |
67 | index = n; | 68 | index = n; |
68 | n++; | 69 | n++; |
69 | } | 70 | } |
70 | setCurrentItem(index); | 71 | setCurrentItem(index); |
71 | } else { | 72 | } else { |
72 | setCurrentItem(0); | 73 | setCurrentItem(0); |
73 | } | 74 | } |
74 | 75 | ||
75 | 76 | ||
76 | 77 | ||
77 | // listen on QPE/System | 78 | // listen on QPE/System |
78 | #if !defined(QT_NO_COP) | 79 | #if !defined(QT_NO_COP) |
79 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | 80 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); |
80 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 81 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
81 | this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) ); | 82 | this, SLOT(handleSystemChannel(const QCString&,const QByteArray&)) ); |
82 | #endif | 83 | #endif |
83 | 84 | ||
84 | 85 | ||
85 | } | 86 | } |
86 | 87 | ||
87 | TZCombo::~TZCombo() | 88 | TZCombo::~TZCombo() |
88 | { | 89 | { |
89 | } | 90 | } |
90 | 91 | ||
91 | void TZCombo::updateZones() | 92 | void TZCombo::updateZones() |
92 | { | 93 | { |
93 | QString cur = currentText(); | 94 | QString cur = currentText(); |
94 | clear(); | 95 | clear(); |