-rw-r--r-- | noncore/apps/opie-reader/CExpander.h | 21 | ||||
-rw-r--r-- | noncore/games/zlines/linesboard.h | 12 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 42 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/modem.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/tabmanager/tablistview.h | 24 |
6 files changed, 53 insertions, 48 deletions
diff --git a/noncore/apps/opie-reader/CExpander.h b/noncore/apps/opie-reader/CExpander.h index 9fae245..553069c 100644 --- a/noncore/apps/opie-reader/CExpander.h +++ b/noncore/apps/opie-reader/CExpander.h | |||
@@ -1,151 +1,158 @@ | |||
1 | #ifndef __CExpander_h | 1 | #ifndef __CExpander_h |
2 | #define __CExpander_h | 2 | #define __CExpander_h |
3 | 3 | ||
4 | #ifndef _WINDOWS | ||
5 | #include <unistd.h> | ||
6 | #endif | ||
7 | #include <stdio.h> | ||
8 | #include <time.h> | ||
9 | #include <qmessagebox.h> | ||
10 | #include "useqpe.h" | 4 | #include "useqpe.h" |
11 | #include "config.h" | 5 | #include "config.h" |
12 | #include "StyleConsts.h" | 6 | #include "StyleConsts.h" |
13 | #include "Markups.h" | 7 | #include "Markups.h" |
14 | #include "names.h" | 8 | #include "names.h" |
15 | #include "linktype.h" | 9 | #include "linktype.h" |
16 | 10 | ||
11 | /* OPIE */ | ||
12 | #include <opie2/odebug.h> | ||
13 | |||
14 | /* QT */ | ||
15 | #include <qmessagebox.h> | ||
16 | |||
17 | /* STD */ | ||
18 | #ifndef _WINDOWS | ||
19 | #include <unistd.h> | ||
20 | #endif | ||
21 | #include <stdio.h> | ||
22 | #include <time.h> | ||
23 | |||
17 | class QImage; | 24 | class QImage; |
18 | class Bkmk; | 25 | class Bkmk; |
19 | 26 | ||
20 | template<class T> | 27 | template<class T> |
21 | class CList; | 28 | class CList; |
22 | 29 | ||
23 | class CCharacterSource | 30 | class CCharacterSource |
24 | { | 31 | { |
25 | public: | 32 | public: |
26 | virtual void getch(tchar&, CStyle&) = 0; | 33 | virtual void getch(tchar&, CStyle&) = 0; |
27 | virtual linkType hyperlink(unsigned int n, QString&) = 0; | 34 | virtual linkType hyperlink(unsigned int n, QString&) = 0; |
28 | }; | 35 | }; |
29 | 36 | ||
30 | class CExpander | 37 | class CExpander |
31 | { | 38 | { |
32 | protected: | 39 | protected: |
33 | size_t m_homepos; | 40 | size_t m_homepos; |
34 | bool m_continuous; | 41 | bool m_continuous; |
35 | char* fname; | 42 | char* fname; |
36 | bool bSuspended; | 43 | bool bSuspended; |
37 | size_t suspos; | 44 | size_t suspos; |
38 | time_t sustime; | 45 | time_t sustime; |
39 | int m_scrWidth; | 46 | int m_scrWidth; |
40 | unsigned long m_currentstart, m_currentend; | 47 | unsigned long m_currentstart, m_currentend; |
41 | public: | 48 | public: |
42 | #ifdef USEQPE | 49 | #ifdef USEQPE |
43 | virtual void suspend() = 0; | 50 | virtual void suspend() = 0; |
44 | virtual void unsuspend() = 0; | 51 | virtual void unsuspend() = 0; |
45 | #endif | 52 | #endif |
46 | size_t getHome() { return m_homepos; } | 53 | size_t getHome() { return m_homepos; } |
47 | CExpander() : m_homepos(0), fname(NULL), m_scrWidth(240), m_currentstart(1), m_currentend(0) {}; | 54 | CExpander() : m_homepos(0), fname(NULL), m_scrWidth(240), m_currentstart(1), m_currentend(0) {}; |
48 | virtual ~CExpander() { if (fname != NULL) delete [] fname; }; | 55 | virtual ~CExpander() { if (fname != NULL) delete [] fname; }; |
49 | int openfile(const char *src) | 56 | int openfile(const char *src) |
50 | { | 57 | { |
51 | bSuspended = false; | 58 | bSuspended = false; |
52 | fname = strdup(src); | 59 | fname = strdup(src); |
53 | return OpenFile(src); | 60 | return OpenFile(src); |
54 | } | 61 | } |
55 | virtual int OpenFile(const char *src) = 0; | 62 | virtual int OpenFile(const char *src) = 0; |
56 | virtual unsigned int locate() = 0; | 63 | virtual unsigned int locate() = 0; |
57 | virtual void locate(unsigned int n) = 0; | 64 | virtual void locate(unsigned int n) = 0; |
58 | virtual bool hasrandomaccess() = 0; | 65 | virtual bool hasrandomaccess() = 0; |
59 | virtual void sizes(unsigned long& file, unsigned long& text) = 0; | 66 | virtual void sizes(unsigned long& file, unsigned long& text) = 0; |
60 | virtual CList<Bkmk>* getbkmklist() { return NULL; } | 67 | virtual CList<Bkmk>* getbkmklist() { return NULL; } |
61 | virtual void getch(tchar& ch, CStyle& sty) | 68 | virtual void getch(tchar& ch, CStyle& sty) |
62 | { | 69 | { |
63 | int ich = getch(); | 70 | int ich = getch(); |
64 | ch = (ich == EOF) ? UEOF : ich; | 71 | ch = (ich == EOF) ? UEOF : ich; |
65 | sty.unset(); | 72 | sty.unset(); |
66 | } | 73 | } |
67 | virtual int getch() = 0; | 74 | virtual int getch() = 0; |
68 | virtual linkType hyperlink(unsigned int n, QString& wrd) | 75 | virtual linkType hyperlink(unsigned int n, QString& wrd) |
69 | { | 76 | { |
70 | locate(n); | 77 | locate(n); |
71 | return eLink; | 78 | return eLink; |
72 | } | 79 | } |
73 | virtual MarkupType PreferredMarkup() = 0; | 80 | virtual MarkupType PreferredMarkup() = 0; |
74 | virtual void saveposn(size_t posn) {} | 81 | virtual void saveposn(size_t posn) {} |
75 | virtual void writeposn(size_t posn) {} | 82 | virtual void writeposn(size_t posn) {} |
76 | virtual bool forward(size_t& loc) { return false; } | 83 | virtual bool forward(size_t& loc) { return false; } |
77 | virtual bool back(size_t& loc) { return false; } | 84 | virtual bool back(size_t& loc) { return false; } |
78 | virtual bool hasnavigation() { return false; } | 85 | virtual bool hasnavigation() { return false; } |
79 | unsigned long startSection() | 86 | unsigned long startSection() |
80 | { | 87 | { |
81 | unsigned long current = locate(); | 88 | unsigned long current = locate(); |
82 | if (m_currentstart > current || current > m_currentend) | 89 | if (m_currentstart > current || current > m_currentend) |
83 | { | 90 | { |
84 | start2endSection(); | 91 | start2endSection(); |
85 | } | 92 | } |
86 | return m_currentstart; | 93 | return m_currentstart; |
87 | } | 94 | } |
88 | unsigned long endSection() | 95 | unsigned long endSection() |
89 | { | 96 | { |
90 | unsigned long current = locate(); | 97 | unsigned long current = locate(); |
91 | if (m_currentstart > current || current > m_currentend) | 98 | if (m_currentstart > current || current > m_currentend) |
92 | { | 99 | { |
93 | start2endSection(); | 100 | start2endSection(); |
94 | } | 101 | } |
95 | return m_currentend; | 102 | return m_currentend; |
96 | } | 103 | } |
97 | virtual void start2endSection() | 104 | virtual void start2endSection() |
98 | { | 105 | { |
99 | m_currentstart = 0; | 106 | m_currentstart = 0; |
100 | unsigned long file; | 107 | unsigned long file; |
101 | sizes(file, m_currentend); | 108 | sizes(file, m_currentend); |
102 | } | 109 | } |
103 | virtual QImage* getPicture(unsigned long tgt) { return NULL; } | 110 | virtual QImage* getPicture(unsigned long tgt) { return NULL; } |
104 | void setContinuous(bool _b) { m_continuous = _b; } | 111 | void setContinuous(bool _b) { m_continuous = _b; } |
105 | #ifdef USEQPE | 112 | #ifdef USEQPE |
106 | virtual void suspend(FILE*& fin) | 113 | virtual void suspend(FILE*& fin) |
107 | { | 114 | { |
108 | bSuspended = true; | 115 | bSuspended = true; |
109 | suspos = ftell(fin); | 116 | suspos = ftell(fin); |
110 | fclose(fin); | 117 | fclose(fin); |
111 | fin = NULL; | 118 | fin = NULL; |
112 | sustime = time(NULL); | 119 | sustime = time(NULL); |
113 | } | 120 | } |
114 | virtual void unsuspend(FILE*& fin) | 121 | virtual void unsuspend(FILE*& fin) |
115 | { | 122 | { |
116 | if (bSuspended) | 123 | if (bSuspended) |
117 | { | 124 | { |
118 | bSuspended = false; | 125 | bSuspended = false; |
119 | int delay = time(NULL) - sustime; | 126 | int delay = time(NULL) - sustime; |
120 | if (delay < 10) sleep(10-delay); | 127 | if (delay < 10) sleep(10-delay); |
121 | fin = fopen(fname, "rb"); | 128 | fin = fopen(fname, "rb"); |
122 | for (int i = 0; fin == NULL && i < 5; i++) | 129 | for (int i = 0; fin == NULL && i < 5; i++) |
123 | { | 130 | { |
124 | sleep(5); | 131 | sleep(5); |
125 | fin = fopen(fname, "rb"); | 132 | fin = fopen(fname, "rb"); |
126 | } | 133 | } |
127 | if (fin == NULL) | 134 | if (fin == NULL) |
128 | { | 135 | { |
129 | QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file"); | 136 | QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file"); |
130 | exit(0); | 137 | exit(0); |
131 | } | 138 | } |
132 | suspos = fseek(fin, suspos, SEEK_SET); | 139 | suspos = fseek(fin, suspos, SEEK_SET); |
133 | } | 140 | } |
134 | } | 141 | } |
135 | #endif | 142 | #endif |
136 | virtual void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) | 143 | virtual void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) |
137 | { | 144 | { |
138 | len = srclen; | 145 | len = srclen; |
139 | data = new unsigned char[len]; | 146 | data = new unsigned char[len]; |
140 | memcpy(data, src, len); | 147 | memcpy(data, src, len); |
141 | } | 148 | } |
142 | virtual void putSaveData(unsigned char*& src, unsigned short& srclen) | 149 | virtual void putSaveData(unsigned char*& src, unsigned short& srclen) |
143 | { | 150 | { |
144 | if (srclen != 0) | 151 | if (srclen != 0) |
145 | { | 152 | { |
146 | qDebug("Don't know what to do with non-zero save data"); | 153 | odebug << "Don't know what to do with non-zero save data" << oendl; |
147 | } | 154 | } |
148 | } | 155 | } |
149 | void setwidth(int w) { m_scrWidth = w; } | 156 | void setwidth(int w) { m_scrWidth = w; } |
150 | }; | 157 | }; |
151 | #endif | 158 | #endif |
diff --git a/noncore/games/zlines/linesboard.h b/noncore/games/zlines/linesboard.h index 97697cd..58478ee 100644 --- a/noncore/games/zlines/linesboard.h +++ b/noncore/games/zlines/linesboard.h | |||
@@ -1,103 +1,95 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | linesboard.h - description | 2 | linesboard.h - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Fri May 19 2000 | 4 | begin : Fri May 19 2000 |
5 | copyright : (C) 2000 by Roman Merzlyakov | 5 | copyright : (C) 2000 by Roman Merzlyakov |
6 | email : roman@sbrf.barrt.ru | 6 | email : roman@sbrf.barrt.ru |
7 | copyright : (C) 2000 by Roman Razilov | 7 | copyright : (C) 2000 by Roman Razilov |
8 | email : Roman.Razilov@gmx.de | 8 | email : Roman.Razilov@gmx.de |
9 | ***************************************************************************/ | 9 | ***************************************************************************/ |
10 | 10 | ||
11 | /*************************************************************************** | 11 | /*************************************************************************** |
12 | * * | 12 | * * |
13 | * This program is free software; you can redistribute it and/or modify * | 13 | * This program is free software; you can redistribute it and/or modify * |
14 | * it under the terms of the GNU General Public License as published by * | 14 | * it under the terms of the GNU General Public License as published by * |
15 | * the Free Software Foundation; either version 2 of the License, or * | 15 | * the Free Software Foundation; either version 2 of the License, or * |
16 | * (at your option) any later version. * | 16 | * (at your option) any later version. * |
17 | * * | 17 | * * |
18 | ***************************************************************************/ | 18 | ***************************************************************************/ |
19 | #ifndef __linesboard_h | 19 | #ifndef __linesboard_h |
20 | #define __linesboard_h | 20 | #define __linesboard_h |
21 | 21 | ||
22 | #include <qwidget.h> | 22 | #include <qwidget.h> |
23 | #include <qpixmap.h> | 23 | #include <qpixmap.h> |
24 | #include <qtimer.h> | 24 | #include <qtimer.h> |
25 | 25 | ||
26 | #include "field.h" | 26 | #include "field.h" |
27 | //#include "shotcounter.h" | 27 | //#include "shotcounter.h" |
28 | #include "ballpainter.h" | 28 | #include "ballpainter.h" |
29 | 29 | ||
30 | #ifdef Q_WS_QWS | ||
31 | #define debug (void) | ||
32 | #else | ||
33 | #define debug qDebug | ||
34 | #endif | ||
35 | #define fatal qFatal | ||
36 | #define warning qWarning | ||
37 | |||
38 | class LinesBoard : public Field | 30 | class LinesBoard : public Field |
39 | { | 31 | { |
40 | Q_OBJECT | 32 | Q_OBJECT |
41 | public: | 33 | public: |
42 | LinesBoard( BallPainter * abPainter, QWidget* parent=0, const char* name=0 ); | 34 | LinesBoard( BallPainter * abPainter, QWidget* parent=0, const char* name=0 ); |
43 | ~LinesBoard(); | 35 | ~LinesBoard(); |
44 | 36 | ||
45 | int width(); | 37 | int width(); |
46 | int height(); | 38 | int height(); |
47 | int wHint(); | 39 | int wHint(); |
48 | int hHint(); | 40 | int hHint(); |
49 | // void doAfterBalls(); | 41 | // void doAfterBalls(); |
50 | void placeBalls(int nextBalls[BALLSDROP]); | 42 | void placeBalls(int nextBalls[BALLSDROP]); |
51 | void undo(); | 43 | void undo(); |
52 | 44 | ||
53 | signals: | 45 | signals: |
54 | void endTurn(); | 46 | void endTurn(); |
55 | void endGame(); | 47 | void endGame(); |
56 | void eraseLine(int nb); | 48 | void eraseLine(int nb); |
57 | 49 | ||
58 | private: | 50 | private: |
59 | int anim; | 51 | int anim; |
60 | 52 | ||
61 | struct Waypoints { | 53 | struct Waypoints { |
62 | int x,y; | 54 | int x,y; |
63 | } *way; | 55 | } *way; |
64 | int nextBalls[BALLSDROP]; | 56 | int nextBalls[BALLSDROP]; |
65 | 57 | ||
66 | int animmax; | 58 | int animmax; |
67 | 59 | ||
68 | //used for running and animation phase | 60 | //used for running and animation phase |
69 | int painting; | 61 | int painting; |
70 | int animstep; | 62 | int animstep; |
71 | int animdelaycount; | 63 | int animdelaycount; |
72 | int animdelaystart; | 64 | int animdelaystart; |
73 | int direction; | 65 | int direction; |
74 | 66 | ||
75 | 67 | ||
76 | int nextBallToPlace; | 68 | int nextBallToPlace; |
77 | int jumpingCol; | 69 | int jumpingCol; |
78 | int jumpingRow; | 70 | int jumpingRow; |
79 | 71 | ||
80 | 72 | ||
81 | QTimer* timer; | 73 | QTimer* timer; |
82 | // ShotCounter* shCounter; | 74 | // ShotCounter* shCounter; |
83 | BallPainter* bPainter; | 75 | BallPainter* bPainter; |
84 | 76 | ||
85 | void paintEvent( QPaintEvent* ); | 77 | void paintEvent( QPaintEvent* ); |
86 | void mousePressEvent( QMouseEvent* ); | 78 | void mousePressEvent( QMouseEvent* ); |
87 | 79 | ||
88 | void AnimStart(int panim); | 80 | void AnimStart(int panim); |
89 | void AnimNext(); | 81 | void AnimNext(); |
90 | int AnimEnd(); | 82 | int AnimEnd(); |
91 | int getAnim(int x, int y ); // returns if the specifyed cell is animated.. | 83 | int getAnim(int x, int y ); // returns if the specifyed cell is animated.. |
92 | void AnimJump( int col, int row ); | 84 | void AnimJump( int col, int row ); |
93 | 85 | ||
94 | int erase5Balls(); | 86 | int erase5Balls(); |
95 | bool existPath(int ax, int ay, int bx, int by); | 87 | bool existPath(int ax, int ay, int bx, int by); |
96 | void placeBall(); | 88 | void placeBall(); |
97 | 89 | ||
98 | protected slots: | 90 | protected slots: |
99 | void timerSlot(); | 91 | void timerSlot(); |
100 | 92 | ||
101 | }; | 93 | }; |
102 | 94 | ||
103 | #endif | 95 | #endif |
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 203ff91..ba4e11a 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp | |||
@@ -1,169 +1,168 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> | 5 | Copyright (c) 2002 L. Potter <ljp@llornkcor.com> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; General Public License for more | 22 | ..}^=.= = ; General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = General Public License along with | 26 | -_. . . )=. = General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | // this file is based on work by trolltech | 34 | // this file is based on work by trolltech |
35 | 35 | ||
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include "mediaplayerstate.h" | 37 | #include "mediaplayerstate.h" |
38 | 38 | ||
39 | #include <assert.h> | 39 | #include <assert.h> |
40 | 40 | ||
41 | //#define MediaPlayerDebug(x) qDebug x | ||
42 | #define MediaPlayerDebug(x) | 41 | #define MediaPlayerDebug(x) |
43 | 42 | ||
44 | 43 | ||
45 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) | 44 | MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) |
46 | : QObject( parent, name ) { | 45 | : QObject( parent, name ) { |
47 | Config cfg( "OpiePlayer" ); | 46 | Config cfg( "OpiePlayer" ); |
48 | readConfig( cfg ); | 47 | readConfig( cfg ); |
49 | streaming = false; | 48 | streaming = false; |
50 | seekable = true; | 49 | seekable = true; |
51 | } | 50 | } |
52 | 51 | ||
53 | 52 | ||
54 | MediaPlayerState::~MediaPlayerState() { | 53 | MediaPlayerState::~MediaPlayerState() { |
55 | } | 54 | } |
56 | 55 | ||
57 | 56 | ||
58 | void MediaPlayerState::readConfig( Config& cfg ) { | 57 | void MediaPlayerState::readConfig( Config& cfg ) { |
59 | cfg.setGroup("Options"); | 58 | cfg.setGroup("Options"); |
60 | fullscreen = cfg.readBoolEntry( "FullScreen" ); | 59 | fullscreen = cfg.readBoolEntry( "FullScreen" ); |
61 | scaled = cfg.readBoolEntry( "Scaling" ); | 60 | scaled = cfg.readBoolEntry( "Scaling" ); |
62 | looping = cfg.readBoolEntry( "Looping" ); | 61 | looping = cfg.readBoolEntry( "Looping" ); |
63 | shuffled = cfg.readBoolEntry( "Shuffle" ); | 62 | shuffled = cfg.readBoolEntry( "Shuffle" ); |
64 | videoGamma = cfg.readNumEntry( "VideoGamma" ); | 63 | videoGamma = cfg.readNumEntry( "VideoGamma" ); |
65 | playing = FALSE; | 64 | playing = FALSE; |
66 | streaming = FALSE; | 65 | streaming = FALSE; |
67 | paused = FALSE; | 66 | paused = FALSE; |
68 | curPosition = 0; | 67 | curPosition = 0; |
69 | curLength = 0; | 68 | curLength = 0; |
70 | m_displayType = MediaSelection; | 69 | m_displayType = MediaSelection; |
71 | } | 70 | } |
72 | 71 | ||
73 | 72 | ||
74 | void MediaPlayerState::writeConfig( Config& cfg ) const { | 73 | void MediaPlayerState::writeConfig( Config& cfg ) const { |
75 | cfg.setGroup( "Options" ); | 74 | cfg.setGroup( "Options" ); |
76 | cfg.writeEntry( "FullScreen", fullscreen ); | 75 | cfg.writeEntry( "FullScreen", fullscreen ); |
77 | cfg.writeEntry( "Scaling", scaled ); | 76 | cfg.writeEntry( "Scaling", scaled ); |
78 | cfg.writeEntry( "Looping", looping ); | 77 | cfg.writeEntry( "Looping", looping ); |
79 | cfg.writeEntry( "Shuffle", shuffled ); | 78 | cfg.writeEntry( "Shuffle", shuffled ); |
80 | cfg.writeEntry( "VideoGamma", videoGamma ); | 79 | cfg.writeEntry( "VideoGamma", videoGamma ); |
81 | } | 80 | } |
82 | 81 | ||
83 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const | 82 | MediaPlayerState::DisplayType MediaPlayerState::displayType() const |
84 | { | 83 | { |
85 | return m_displayType; | 84 | return m_displayType; |
86 | } | 85 | } |
87 | 86 | ||
88 | // slots | 87 | // slots |
89 | void MediaPlayerState::setIsStreaming( bool b ) { | 88 | void MediaPlayerState::setIsStreaming( bool b ) { |
90 | streaming = b; | 89 | streaming = b; |
91 | } | 90 | } |
92 | 91 | ||
93 | void MediaPlayerState::setIsSeekable( bool b ) { | 92 | void MediaPlayerState::setIsSeekable( bool b ) { |
94 | seekable = b; | 93 | seekable = b; |
95 | emit isSeekableToggled(b); | 94 | emit isSeekableToggled(b); |
96 | } | 95 | } |
97 | 96 | ||
98 | 97 | ||
99 | void MediaPlayerState::setFullscreen( bool b ) { | 98 | void MediaPlayerState::setFullscreen( bool b ) { |
100 | if ( fullscreen == b ) { | 99 | if ( fullscreen == b ) { |
101 | return; | 100 | return; |
102 | } | 101 | } |
103 | fullscreen = b; | 102 | fullscreen = b; |
104 | emit fullscreenToggled(b); | 103 | emit fullscreenToggled(b); |
105 | } | 104 | } |
106 | 105 | ||
107 | 106 | ||
108 | void MediaPlayerState::setBlanked( bool b ) { | 107 | void MediaPlayerState::setBlanked( bool b ) { |
109 | if ( blanked == b ) { | 108 | if ( blanked == b ) { |
110 | return; | 109 | return; |
111 | } | 110 | } |
112 | blanked = b; | 111 | blanked = b; |
113 | emit blankToggled(b); | 112 | emit blankToggled(b); |
114 | } | 113 | } |
115 | 114 | ||
116 | 115 | ||
117 | void MediaPlayerState::setScaled( bool b ) { | 116 | void MediaPlayerState::setScaled( bool b ) { |
118 | if ( scaled == b ) { | 117 | if ( scaled == b ) { |
119 | return; | 118 | return; |
120 | } | 119 | } |
121 | scaled = b; | 120 | scaled = b; |
122 | emit scaledToggled(b); | 121 | emit scaledToggled(b); |
123 | } | 122 | } |
124 | 123 | ||
125 | void MediaPlayerState::setLooping( bool b ) { | 124 | void MediaPlayerState::setLooping( bool b ) { |
126 | if ( looping == b ) { | 125 | if ( looping == b ) { |
127 | return; | 126 | return; |
128 | } | 127 | } |
129 | looping = b; | 128 | looping = b; |
130 | emit loopingToggled(b); | 129 | emit loopingToggled(b); |
131 | } | 130 | } |
132 | 131 | ||
133 | void MediaPlayerState::setShuffled( bool b ) { | 132 | void MediaPlayerState::setShuffled( bool b ) { |
134 | if ( shuffled == b ) { | 133 | if ( shuffled == b ) { |
135 | return; | 134 | return; |
136 | } | 135 | } |
137 | shuffled = b; | 136 | shuffled = b; |
138 | emit shuffledToggled(b); | 137 | emit shuffledToggled(b); |
139 | } | 138 | } |
140 | 139 | ||
141 | void MediaPlayerState::setPaused( bool b ) { | 140 | void MediaPlayerState::setPaused( bool b ) { |
142 | if ( paused == b ) { | 141 | if ( paused == b ) { |
143 | paused = FALSE; | 142 | paused = FALSE; |
144 | emit pausedToggled(FALSE); | 143 | emit pausedToggled(FALSE); |
145 | return; | 144 | return; |
146 | } | 145 | } |
147 | paused = b; | 146 | paused = b; |
148 | emit pausedToggled(b); | 147 | emit pausedToggled(b); |
149 | } | 148 | } |
150 | 149 | ||
151 | void MediaPlayerState::setPlaying( bool b ) { | 150 | void MediaPlayerState::setPlaying( bool b ) { |
152 | if ( playing == b ) { | 151 | if ( playing == b ) { |
153 | return; | 152 | return; |
154 | } | 153 | } |
155 | playing = b; | 154 | playing = b; |
156 | stopped = !b; | 155 | stopped = !b; |
157 | emit playingToggled(b); | 156 | emit playingToggled(b); |
158 | } | 157 | } |
159 | 158 | ||
160 | void MediaPlayerState::setStopped( bool b ) { | 159 | void MediaPlayerState::setStopped( bool b ) { |
161 | if ( stopped == b ) { | 160 | if ( stopped == b ) { |
162 | return; | 161 | return; |
163 | } | 162 | } |
164 | stopped = b; | 163 | stopped = b; |
165 | emit stopToggled(b); | 164 | emit stopToggled(b); |
166 | } | 165 | } |
167 | 166 | ||
168 | void MediaPlayerState::setPosition( long p ) { | 167 | void MediaPlayerState::setPosition( long p ) { |
169 | if ( curPosition == p ) { | 168 | if ( curPosition == p ) { |
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index 27e2823..bf27b97 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h | |||
@@ -1,161 +1,165 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #include "maildefines.h" | 4 | #include "maildefines.h" |
5 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | |||
9 | /* QT */ | ||
6 | #include <qobject.h> | 10 | #include <qobject.h> |
7 | #include <qlist.h> | 11 | #include <qlist.h> |
8 | 12 | ||
9 | class Account | 13 | class Account |
10 | { | 14 | { |
11 | 15 | ||
12 | public: | 16 | public: |
13 | Account(); | 17 | Account(); |
14 | virtual ~Account() {} | 18 | virtual ~Account() {} |
15 | 19 | ||
16 | void remove(); | 20 | void remove(); |
17 | void setAccountName( QString name ) { accountName = name; } | 21 | void setAccountName( QString name ) { accountName = name; } |
18 | const QString&getAccountName()const{ return accountName; } | 22 | const QString&getAccountName()const{ return accountName; } |
19 | MAILLIB::ATYPE getType()const{ return type; } | 23 | MAILLIB::ATYPE getType()const{ return type; } |
20 | 24 | ||
21 | void setServer(const QString&str){ server = str; } | 25 | void setServer(const QString&str){ server = str; } |
22 | const QString&getServer()const{ return server; } | 26 | const QString&getServer()const{ return server; } |
23 | 27 | ||
24 | void setPort(const QString&str) { port = str; } | 28 | void setPort(const QString&str) { port = str; } |
25 | const QString&getPort()const{ return port; } | 29 | const QString&getPort()const{ return port; } |
26 | 30 | ||
27 | void setUser(const QString&str){ user = str; } | 31 | void setUser(const QString&str){ user = str; } |
28 | const QString&getUser()const{ return user; } | 32 | const QString&getUser()const{ return user; } |
29 | 33 | ||
30 | void setPassword(const QString&str) { password = str; } | 34 | void setPassword(const QString&str) { password = str; } |
31 | const QString&getPassword()const { return password; } | 35 | const QString&getPassword()const { return password; } |
32 | 36 | ||
33 | void setSSL( bool b ) { ssl = b; } | 37 | void setSSL( bool b ) { ssl = b; } |
34 | bool getSSL() { return ssl; } | 38 | bool getSSL() { return ssl; } |
35 | 39 | ||
36 | void setConnectionType( int x ) { connectionType = x; } | 40 | void setConnectionType( int x ) { connectionType = x; } |
37 | int ConnectionType() { return connectionType; } | 41 | int ConnectionType() { return connectionType; } |
38 | 42 | ||
39 | 43 | ||
40 | void setOffline(bool b) {offline = b;} | 44 | void setOffline(bool b) {offline = b;} |
41 | bool getOffline()const{return offline;} | 45 | bool getOffline()const{return offline;} |
42 | 46 | ||
43 | virtual QString getFileName() { return accountName; } | 47 | virtual QString getFileName() { return accountName; } |
44 | virtual void read() { qDebug( "base reading..." ); } | 48 | virtual void read() { odebug << "base reading..." << oendl; } |
45 | virtual void save() { qDebug( "base saving..." ); } | 49 | virtual void save() { odebug << "base saving..." << oendl; } |
46 | 50 | ||
47 | protected: | 51 | protected: |
48 | QString accountName, server, port, user, password; | 52 | QString accountName, server, port, user, password; |
49 | bool ssl; | 53 | bool ssl; |
50 | int connectionType; | 54 | int connectionType; |
51 | bool offline; | 55 | bool offline; |
52 | MAILLIB::ATYPE type; | 56 | MAILLIB::ATYPE type; |
53 | }; | 57 | }; |
54 | 58 | ||
55 | class IMAPaccount : public Account | 59 | class IMAPaccount : public Account |
56 | { | 60 | { |
57 | 61 | ||
58 | public: | 62 | public: |
59 | IMAPaccount(); | 63 | IMAPaccount(); |
60 | IMAPaccount( QString filename ); | 64 | IMAPaccount( QString filename ); |
61 | 65 | ||
62 | static QString getUniqueFileName(); | 66 | static QString getUniqueFileName(); |
63 | 67 | ||
64 | virtual void read(); | 68 | virtual void read(); |
65 | virtual void save(); | 69 | virtual void save(); |
66 | virtual QString getFileName(); | 70 | virtual QString getFileName(); |
67 | 71 | ||
68 | void setPrefix(const QString&str) {prefix=str;} | 72 | void setPrefix(const QString&str) {prefix=str;} |
69 | const QString&getPrefix()const{return prefix;} | 73 | const QString&getPrefix()const{return prefix;} |
70 | 74 | ||
71 | private: | 75 | private: |
72 | QString file,prefix; | 76 | QString file,prefix; |
73 | 77 | ||
74 | }; | 78 | }; |
75 | 79 | ||
76 | class POP3account : public Account | 80 | class POP3account : public Account |
77 | { | 81 | { |
78 | 82 | ||
79 | public: | 83 | public: |
80 | POP3account(); | 84 | POP3account(); |
81 | POP3account( QString filename ); | 85 | POP3account( QString filename ); |
82 | 86 | ||
83 | static QString getUniqueFileName(); | 87 | static QString getUniqueFileName(); |
84 | 88 | ||
85 | virtual void read(); | 89 | virtual void read(); |
86 | virtual void save(); | 90 | virtual void save(); |
87 | virtual QString getFileName(); | 91 | virtual QString getFileName(); |
88 | 92 | ||
89 | private: | 93 | private: |
90 | QString file; | 94 | QString file; |
91 | 95 | ||
92 | }; | 96 | }; |
93 | 97 | ||
94 | class SMTPaccount : public Account | 98 | class SMTPaccount : public Account |
95 | { | 99 | { |
96 | 100 | ||
97 | public: | 101 | public: |
98 | SMTPaccount(); | 102 | SMTPaccount(); |
99 | SMTPaccount( QString filename ); | 103 | SMTPaccount( QString filename ); |
100 | 104 | ||
101 | static QString getUniqueFileName(); | 105 | static QString getUniqueFileName(); |
102 | 106 | ||
103 | virtual void read(); | 107 | virtual void read(); |
104 | virtual void save(); | 108 | virtual void save(); |
105 | virtual QString getFileName(); | 109 | virtual QString getFileName(); |
106 | 110 | ||
107 | void setLogin( bool b ) { login = b; } | 111 | void setLogin( bool b ) { login = b; } |
108 | bool getLogin() { return login; } | 112 | bool getLogin() { return login; } |
109 | 113 | ||
110 | private: | 114 | private: |
111 | QString file, name, mail, org, cc, bcc, reply, signature; | 115 | QString file, name, mail, org, cc, bcc, reply, signature; |
112 | bool useCC, useBCC, useReply, login; | 116 | bool useCC, useBCC, useReply, login; |
113 | 117 | ||
114 | }; | 118 | }; |
115 | 119 | ||
116 | class NNTPaccount : public Account | 120 | class NNTPaccount : public Account |
117 | { | 121 | { |
118 | 122 | ||
119 | public: | 123 | public: |
120 | NNTPaccount(); | 124 | NNTPaccount(); |
121 | NNTPaccount( QString filename ); | 125 | NNTPaccount( QString filename ); |
122 | 126 | ||
123 | static QString getUniqueFileName(); | 127 | static QString getUniqueFileName(); |
124 | 128 | ||
125 | virtual void read(); | 129 | virtual void read(); |
126 | virtual void save(); | 130 | virtual void save(); |
127 | virtual QString getFileName(); | 131 | virtual QString getFileName(); |
128 | 132 | ||
129 | void setLogin( bool b ) { login = b; } | 133 | void setLogin( bool b ) { login = b; } |
130 | bool getLogin() { return login; } | 134 | bool getLogin() { return login; } |
131 | 135 | ||
132 | void setGroups( QStringList list ) { subscribedGroups = list; } | 136 | void setGroups( QStringList list ) { subscribedGroups = list; } |
133 | QStringList getGroups() { return subscribedGroups; } | 137 | QStringList getGroups() { return subscribedGroups; } |
134 | 138 | ||
135 | private: | 139 | private: |
136 | QString file; | 140 | QString file; |
137 | bool login; | 141 | bool login; |
138 | QStringList subscribedGroups; | 142 | QStringList subscribedGroups; |
139 | 143 | ||
140 | }; | 144 | }; |
141 | 145 | ||
142 | class Settings : public QObject | 146 | class Settings : public QObject |
143 | { | 147 | { |
144 | Q_OBJECT | 148 | Q_OBJECT |
145 | 149 | ||
146 | public: | 150 | public: |
147 | Settings(); | 151 | Settings(); |
148 | QList<Account> getAccounts(); | 152 | QList<Account> getAccounts(); |
149 | void addAccount(Account *account); | 153 | void addAccount(Account *account); |
150 | void delAccount(Account *account); | 154 | void delAccount(Account *account); |
151 | void saveAccounts(); | 155 | void saveAccounts(); |
152 | void readAccounts(); | 156 | void readAccounts(); |
153 | static void checkDirectory(); | 157 | static void checkDirectory(); |
154 | 158 | ||
155 | private: | 159 | private: |
156 | void updateAccounts(); | 160 | void updateAccounts(); |
157 | QList<Account> accounts; | 161 | QList<Account> accounts; |
158 | 162 | ||
159 | }; | 163 | }; |
160 | 164 | ||
161 | #endif | 165 | #endif |
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp index 3bc7d43..79f015b 100644 --- a/noncore/settings/networksettings/ppp/modem.cpp +++ b/noncore/settings/networksettings/ppp/modem.cpp | |||
@@ -1,187 +1,186 @@ | |||
1 | /* | 1 | /* |
2 | * kPPP: A pppd Front End for the KDE project | 2 | * kPPP: A pppd Front End for the KDE project |
3 | * | 3 | * |
4 | * $Id$ | 4 | * $Id$ |
5 | * | 5 | * |
6 | * Copyright (C) 1997 Bernd Johannes Wuebben | 6 | * Copyright (C) 1997 Bernd Johannes Wuebben |
7 | * wuebben@math.cornell.edu | 7 | * wuebben@math.cornell.edu |
8 | * | 8 | * |
9 | * This file was added by Harri Porten <porten@tu-harburg.de> | 9 | * This file was added by Harri Porten <porten@tu-harburg.de> |
10 | * | 10 | * |
11 | * | 11 | * |
12 | * This program is free software; you can redistribute it and/or | 12 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU Library General Public | 13 | * modify it under the terms of the GNU Library General Public |
14 | * License as published by the Free Software Foundation; either | 14 | * License as published by the Free Software Foundation; either |
15 | * version 2 of the License, or (at your option) any later version. | 15 | * version 2 of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * This program is distributed in the hope that it will be useful, | 17 | * This program is distributed in the hope that it will be useful, |
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | * Library General Public License for more details. | 20 | * Library General Public License for more details. |
21 | * | 21 | * |
22 | * You should have received a copy of the GNU Library General Public | 22 | * You should have received a copy of the GNU Library General Public |
23 | * License along with this program; if not, write to the Free | 23 | * License along with this program; if not, write to the Free |
24 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 24 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | /* OPIE */ | 27 | /* OPIE */ |
28 | #include <opie2/odebug.h> | 28 | #include <opie2/odebug.h> |
29 | using namespace Opie::Core; | 29 | using namespace Opie::Core; |
30 | 30 | ||
31 | /* STD */ | 31 | /* STD */ |
32 | #include <errno.h> | 32 | #include <errno.h> |
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | #include <unistd.h> | 34 | #include <unistd.h> |
35 | #include <fcntl.h> | 35 | #include <fcntl.h> |
36 | #include <signal.h> | 36 | #include <signal.h> |
37 | #include <sys/ioctl.h> | 37 | #include <sys/ioctl.h> |
38 | #include <sys/types.h> | 38 | #include <sys/types.h> |
39 | #include <sys/stat.h> | 39 | #include <sys/stat.h> |
40 | #include <setjmp.h> | 40 | #include <setjmp.h> |
41 | #include <regex.h> | 41 | #include <regex.h> |
42 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <assert.h> | 43 | #include <assert.h> |
44 | #include <string.h> | 44 | #include <string.h> |
45 | 45 | ||
46 | #ifdef HAVE_RESOLV_H | 46 | #ifdef HAVE_RESOLV_H |
47 | # include <arpa/nameser.h> | 47 | # include <arpa/nameser.h> |
48 | # include <resolv.h> | 48 | # include <resolv.h> |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifndef _PATH_RESCONF | 51 | #ifndef _PATH_RESCONF |
52 | #define _PATH_RESCONF "/etc/resolv.conf" | 52 | #define _PATH_RESCONF "/etc/resolv.conf" |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #define strlcpy strcpy | 55 | #define strlcpy strcpy |
56 | #include "auth.h" | 56 | #include "auth.h" |
57 | #include "modem.h" | 57 | #include "modem.h" |
58 | #include "pppdata.h" | 58 | #include "pppdata.h" |
59 | #define qError qDebug | ||
60 | 59 | ||
61 | 60 | ||
62 | #define MY_ASSERT(x) if (!(x)) { \ | 61 | #define MY_ASSERT(x) if (!(x)) { \ |
63 | ofatal << "ASSERT: \"" << #x << "\" in " << __FILE__ << " (" << __LINE__ << ")\n" << oendl; \ | 62 | ofatal << "ASSERT: \"" << #x << "\" in " << __FILE__ << " (" << __LINE__ << ")\n" << oendl; \ |
64 | exit(1); } | 63 | exit(1); } |
65 | 64 | ||
66 | 65 | ||
67 | static sigjmp_buf jmp_buffer; | 66 | static sigjmp_buf jmp_buffer; |
68 | 67 | ||
69 | //Modem *Modem::modem = 0; | 68 | //Modem *Modem::modem = 0; |
70 | 69 | ||
71 | 70 | ||
72 | const char* pppdPath() { | 71 | const char* pppdPath() { |
73 | // wasting a few bytes | 72 | // wasting a few bytes |
74 | static char buffer[sizeof(PPPDSEARCHPATH)+sizeof(PPPDNAME)]; | 73 | static char buffer[sizeof(PPPDSEARCHPATH)+sizeof(PPPDNAME)]; |
75 | static char *pppdPath = 0L; | 74 | static char *pppdPath = 0L; |
76 | char *p; | 75 | char *p; |
77 | 76 | ||
78 | if(pppdPath == 0L) { | 77 | if(pppdPath == 0L) { |
79 | const char *c = PPPDSEARCHPATH; | 78 | const char *c = PPPDSEARCHPATH; |
80 | while(*c != '\0') { | 79 | while(*c != '\0') { |
81 | while(*c == ':') | 80 | while(*c == ':') |
82 | c++; | 81 | c++; |
83 | p = buffer; | 82 | p = buffer; |
84 | while(*c != '\0' && *c != ':') | 83 | while(*c != '\0' && *c != ':') |
85 | *p++ = *c++; | 84 | *p++ = *c++; |
86 | *p = '\0'; | 85 | *p = '\0'; |
87 | strcat(p, "/"); | 86 | strcat(p, "/"); |
88 | strcat(p, PPPDNAME); | 87 | strcat(p, PPPDNAME); |
89 | if(access(buffer, F_OK) == 0) | 88 | if(access(buffer, F_OK) == 0) |
90 | return (pppdPath = buffer); | 89 | return (pppdPath = buffer); |
91 | } | 90 | } |
92 | } | 91 | } |
93 | 92 | ||
94 | return pppdPath; | 93 | return pppdPath; |
95 | } | 94 | } |
96 | 95 | ||
97 | 96 | ||
98 | Modem::Modem( PPPData* pd ) | 97 | Modem::Modem( PPPData* pd ) |
99 | { | 98 | { |
100 | _pppdata = pd; | 99 | _pppdata = pd; |
101 | modemfd = -1; | 100 | modemfd = -1; |
102 | _pppdExitStatus = -1; | 101 | _pppdExitStatus = -1; |
103 | pppdPid = -1; | 102 | pppdPid = -1; |
104 | sn = m_modemDebug = 0L; | 103 | sn = m_modemDebug = 0L; |
105 | data_mode = false; | 104 | data_mode = false; |
106 | modem_is_locked = false; | 105 | modem_is_locked = false; |
107 | lockfile[0] = '\0'; | 106 | lockfile[0] = '\0'; |
108 | device = "/dev/modem"; | 107 | device = "/dev/modem"; |
109 | } | 108 | } |
110 | 109 | ||
111 | 110 | ||
112 | Modem::~Modem() | 111 | Modem::~Modem() |
113 | { | 112 | { |
114 | } | 113 | } |
115 | 114 | ||
116 | 115 | ||
117 | speed_t Modem::modemspeed() { | 116 | speed_t Modem::modemspeed() { |
118 | // convert the string modem speed int the gpppdata object to a t_speed type | 117 | // convert the string modem speed int the gpppdata object to a t_speed type |
119 | // to set the modem. The constants here should all be ifdef'd because | 118 | // to set the modem. The constants here should all be ifdef'd because |
120 | // other systems may not have them | 119 | // other systems may not have them |
121 | int i = _pppdata->speed().toInt()/100; | 120 | int i = _pppdata->speed().toInt()/100; |
122 | 121 | ||
123 | switch(i) { | 122 | switch(i) { |
124 | case 24: | 123 | case 24: |
125 | return B2400; | 124 | return B2400; |
126 | break; | 125 | break; |
127 | case 96: | 126 | case 96: |
128 | return B9600; | 127 | return B9600; |
129 | break; | 128 | break; |
130 | case 192: | 129 | case 192: |
131 | return B19200; | 130 | return B19200; |
132 | break; | 131 | break; |
133 | case 384: | 132 | case 384: |
134 | return B38400; | 133 | return B38400; |
135 | break; | 134 | break; |
136 | #ifdef B57600 | 135 | #ifdef B57600 |
137 | case 576: | 136 | case 576: |
138 | return B57600; | 137 | return B57600; |
139 | break; | 138 | break; |
140 | #endif | 139 | #endif |
141 | 140 | ||
142 | #ifdef B115200 | 141 | #ifdef B115200 |
143 | case 1152: | 142 | case 1152: |
144 | return B115200; | 143 | return B115200; |
145 | break; | 144 | break; |
146 | #endif | 145 | #endif |
147 | 146 | ||
148 | #ifdef B230400 | 147 | #ifdef B230400 |
149 | case 2304: | 148 | case 2304: |
150 | return B230400; | 149 | return B230400; |
151 | break; | 150 | break; |
152 | #endif | 151 | #endif |
153 | 152 | ||
154 | #ifdef B460800 | 153 | #ifdef B460800 |
155 | case 4608: | 154 | case 4608: |
156 | return B460800; | 155 | return B460800; |
157 | break; | 156 | break; |
158 | #endif | 157 | #endif |
159 | 158 | ||
160 | default: | 159 | default: |
161 | return B38400; | 160 | return B38400; |
162 | break; | 161 | break; |
163 | } | 162 | } |
164 | } | 163 | } |
165 | 164 | ||
166 | bool Modem::opentty() { | 165 | bool Modem::opentty() { |
167 | // int flags; | 166 | // int flags; |
168 | 167 | ||
169 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { | 168 | //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { |
170 | close(modemfd); | 169 | close(modemfd); |
171 | device = _pppdata->modemDevice(); | 170 | device = _pppdata->modemDevice(); |
172 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { | 171 | if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { |
173 | odebug << "error opening modem device !" << oendl; | 172 | odebug << "error opening modem device !" << oendl; |
174 | errmsg = QObject::tr("Unable to open modem."); | 173 | errmsg = QObject::tr("Unable to open modem."); |
175 | return false; | 174 | return false; |
176 | } | 175 | } |
177 | //bend if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { | 176 | //bend if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { |
178 | //} | 177 | //} |
179 | 178 | ||
180 | #if 0 | 179 | #if 0 |
181 | if(_pppdata->UseCDLine()) { | 180 | if(_pppdata->UseCDLine()) { |
182 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { | 181 | if(ioctl(modemfd, TIOCMGET, &flags) == -1) { |
183 | errmsg = QObject::tr("Unable to detect state of CD line."); | 182 | errmsg = QObject::tr("Unable to detect state of CD line."); |
184 | ::close(modemfd); | 183 | ::close(modemfd); |
185 | modemfd = -1; | 184 | modemfd = -1; |
186 | return false; | 185 | return false; |
187 | } | 186 | } |
diff --git a/noncore/settings/tabmanager/tablistview.h b/noncore/settings/tabmanager/tablistview.h index dfd88f7..54b87b6 100644 --- a/noncore/settings/tabmanager/tablistview.h +++ b/noncore/settings/tabmanager/tablistview.h | |||
@@ -1,65 +1,69 @@ | |||
1 | #ifndef TABLISTVIEW_H | 1 | #ifndef TABLISTVIEW_H |
2 | #define TABLISTVIEW_H | 2 | #define TABLISTVIEW_H |
3 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | |||
7 | /* QT */ | ||
4 | #include <qlistview.h> | 8 | #include <qlistview.h> |
5 | #include <qcursor.h> | 9 | #include <qcursor.h> |
6 | #include <qapplication.h> | 10 | #include <qapplication.h> |
7 | 11 | ||
8 | class TabListView : public QListView { | 12 | class TabListView : public QListView { |
9 | Q_OBJECT | 13 | Q_OBJECT |
10 | 14 | ||
11 | signals: | 15 | signals: |
12 | void moveItem(QListViewItem *item, QListViewItem *newFolder); | 16 | void moveItem(QListViewItem *item, QListViewItem *newFolder); |
13 | 17 | ||
14 | public: | 18 | public: |
15 | TabListView( QWidget* parent = 0, const char* name = 0) : QListView(parent, name){ currentSelectedItem = NULL; | 19 | TabListView( QWidget* parent = 0, const char* name = 0) : QListView(parent, name){ currentSelectedItem = NULL; |
16 | connect(this, SIGNAL(pressed ( QListViewItem *)), this, SLOT(itemPressed(QListViewItem *))); | 20 | connect(this, SIGNAL(pressed ( QListViewItem *)), this, SLOT(itemPressed(QListViewItem *))); |
17 | internalCursor.setShape(0); | 21 | internalCursor.setShape(0); |
18 | }; | 22 | }; |
19 | 23 | ||
20 | protected: | 24 | protected: |
21 | void contentsMouseReleaseEvent(QMouseEvent* ){ | 25 | void contentsMouseReleaseEvent(QMouseEvent* ){ |
22 | QListViewItem *newGroup = this->currentItem(); | 26 | QListViewItem *newGroup = this->currentItem(); |
23 | // Make sure they are both real. | 27 | // Make sure they are both real. |
24 | if (currentSelectedItem == NULL || newGroup == NULL) | 28 | if (currentSelectedItem == NULL || newGroup == NULL) |
25 | return; | 29 | return; |
26 | // Make sure they are not the same | 30 | // Make sure they are not the same |
27 | if(this->isSelected(currentSelectedItem) == true) | 31 | if(this->isSelected(currentSelectedItem) == true) |
28 | return; | 32 | return; |
29 | 33 | ||
30 | // Ok we have two valid items. | 34 | // Ok we have two valid items. |
31 | if(newGroup->parent()) | 35 | if(newGroup->parent()) |
32 | newGroup = newGroup->parent(); | 36 | newGroup = newGroup->parent(); |
33 | 37 | ||
34 | // Just in case the parent was null | 38 | // Just in case the parent was null |
35 | if(newGroup == NULL) | 39 | if(newGroup == NULL) |
36 | return; | 40 | return; |
37 | 41 | ||
38 | // If the new folder and buddies current parent are the same don't do anything. | 42 | // If the new folder and buddies current parent are the same don't do anything. |
39 | if (newGroup != currentSelectedItem->parent()) | 43 | if (newGroup != currentSelectedItem->parent()) |
40 | moveItem(currentSelectedItem, newGroup); | 44 | moveItem(currentSelectedItem, newGroup); |
41 | currentSelectedItem = NULL; | 45 | currentSelectedItem = NULL; |
42 | qApp->restoreOverrideCursor(); | 46 | qApp->restoreOverrideCursor(); |
43 | }; | 47 | }; |
44 | 48 | ||
45 | private slots: | 49 | private slots: |
46 | void itemPressed(QListViewItem *item){ | 50 | void itemPressed(QListViewItem *item){ |
47 | if(item == NULL || !item->parent()){ | 51 | if(item == NULL || !item->parent()){ |
48 | if(item == NULL) | 52 | if(item == NULL) |
49 | qDebug("Item is NULL"); | 53 | odebug << "Item is NULL" << oendl; |
50 | return; | 54 | return; |
51 | } | 55 | } |
52 | 56 | ||
53 | currentSelectedItem = item; | 57 | currentSelectedItem = item; |
54 | internalCursor.setShape(13); | 58 | internalCursor.setShape(13); |
55 | qApp->setOverrideCursor(internalCursor); | 59 | qApp->setOverrideCursor(internalCursor); |
56 | }; | 60 | }; |
57 | 61 | ||
58 | 62 | ||
59 | private: | 63 | private: |
60 | QListViewItem *currentSelectedItem; | 64 | QListViewItem *currentSelectedItem; |
61 | QCursor internalCursor; | 65 | QCursor internalCursor; |
62 | }; | 66 | }; |
63 | 67 | ||
64 | #endif | 68 | #endif |
65 | 69 | ||