author | zecke <zecke> | 2002-06-13 19:03:11 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-13 19:03:11 (UTC) |
commit | 9976f7357601e33c4a1984bf79a68ac344fdd188 (patch) (unidiff) | |
tree | a9c9229ee77bcf749b1bb008b4bccfa94b2b2bbd | |
parent | 1f26f23cdd2009c1ee9ae79fafb340936b199f2c (diff) | |
download | opie-9976f7357601e33c4a1984bf79a68ac344fdd188.zip opie-9976f7357601e33c4a1984bf79a68ac344fdd188.tar.gz opie-9976f7357601e33c4a1984bf79a68ac344fdd188.tar.bz2 |
receive(bool) -> receive(int) cause QDataStream is not capable of bool
-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 8 | ||||
-rw-r--r-- | core/applets/irdaapplet/irda.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index 03912aa..28a79d1 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp | |||
@@ -148,75 +148,75 @@ void IrdaApplet::mousePressEvent( QMouseEvent *) { | |||
148 | menu->insertItem( tr("Enable Discovery"), 3 ); | 148 | menu->insertItem( tr("Enable Discovery"), 3 ); |
149 | 149 | ||
150 | if( receiveActive ){ | 150 | if( receiveActive ){ |
151 | menu->insertItem( tr("Disable Receive"), 5 ); | 151 | menu->insertItem( tr("Disable Receive"), 5 ); |
152 | } else { | 152 | } else { |
153 | menu->insertItem( tr("Enable Receive"), 4 ); | 153 | menu->insertItem( tr("Enable Receive"), 4 ); |
154 | } | 154 | } |
155 | 155 | ||
156 | QPoint p = mapToGlobal( QPoint(1, menu->sizeHint().height()-1) ); | 156 | QPoint p = mapToGlobal( QPoint(1, menu->sizeHint().height()-1) ); |
157 | ret = menu->exec(p, 2); | 157 | ret = menu->exec(p, 2); |
158 | 158 | ||
159 | qDebug("ret was %d\n", ret); | 159 | qDebug("ret was %d\n", ret); |
160 | 160 | ||
161 | switch(ret) { | 161 | switch(ret) { |
162 | case 0: | 162 | case 0: |
163 | setIrdaStatus(0); | 163 | setIrdaStatus(0); |
164 | timerEvent(NULL); | 164 | timerEvent(NULL); |
165 | break; | 165 | break; |
166 | case 1: | 166 | case 1: |
167 | setIrdaStatus(1); | 167 | setIrdaStatus(1); |
168 | timerEvent(NULL); | 168 | timerEvent(NULL); |
169 | break; | 169 | break; |
170 | case 2: | 170 | case 2: |
171 | setIrdaDiscoveryStatus(0); | 171 | setIrdaDiscoveryStatus(0); |
172 | timerEvent(NULL); | 172 | timerEvent(NULL); |
173 | break; | 173 | break; |
174 | case 3: | 174 | case 3: |
175 | setIrdaDiscoveryStatus(1); | 175 | setIrdaDiscoveryStatus(1); |
176 | timerEvent(NULL); // NULL is undefined in c++ use 0 or 0l | 176 | timerEvent(NULL); // NULL is undefined in c++ use 0 or 0l |
177 | break; | 177 | break; |
178 | case 4: { // enable receive | 178 | case 4: { // enable receive |
179 | qWarning("Enable receive" ); | 179 | qWarning("Enable receive" ); |
180 | QCopEnvelope e("QPE/Obex", "receive(bool)" ); | 180 | QCopEnvelope e("QPE/Obex", "receive(int)" ); |
181 | e << true; | 181 | e << 1; |
182 | receiveActive = true; | 182 | receiveActive = true; |
183 | receiveStateChanged = true; | 183 | receiveStateChanged = true; |
184 | timerEvent(NULL); | 184 | timerEvent(NULL); |
185 | break; | 185 | break; |
186 | } | 186 | } |
187 | case 5: { // disable receive | 187 | case 5: { // disable receive |
188 | qWarning("Disable receive" ); | 188 | qWarning("Disable receive" ); |
189 | QCopEnvelope e("QPE/Obex", "receive(bool)" ); | 189 | QCopEnvelope e("QPE/Obex", "receive(int)" ); |
190 | e << false; | 190 | e << 0; |
191 | receiveActive = false; | 191 | receiveActive = false; |
192 | receiveStateChanged = true; | 192 | receiveStateChanged = true; |
193 | timerEvent(NULL); | 193 | timerEvent(NULL); |
194 | break; | 194 | break; |
195 | } | 195 | } |
196 | case 6: | 196 | case 6: |
197 | qDebug("FIXME: Bring up pretty menu...\n"); | 197 | qDebug("FIXME: Bring up pretty menu...\n"); |
198 | // With table of currently-detected devices. | 198 | // With table of currently-detected devices. |
199 | } | 199 | } |
200 | delete menu; // Can somebody explain why use a QPopupMenu* and not QPopupMenu nor QAction. with out delete we will leak cause QPopupMenu doesn't have a parent in this case | 200 | delete menu; // Can somebody explain why use a QPopupMenu* and not QPopupMenu nor QAction. with out delete we will leak cause QPopupMenu doesn't have a parent in this case |
201 | } | 201 | } |
202 | 202 | ||
203 | void IrdaApplet::timerEvent( QTimerEvent * ) { | 203 | void IrdaApplet::timerEvent( QTimerEvent * ) { |
204 | int oldactive = irdaactive; | 204 | int oldactive = irdaactive; |
205 | int olddiscovery = irdaDiscoveryActive; | 205 | int olddiscovery = irdaDiscoveryActive; |
206 | bool receiveUpdate = false; | 206 | bool receiveUpdate = false; |
207 | 207 | ||
208 | if (receiveStateChanged) { | 208 | if (receiveStateChanged) { |
209 | receiveUpdate = true; | 209 | receiveUpdate = true; |
210 | receiveStateChanged = false; | 210 | receiveStateChanged = false; |
211 | } | 211 | } |
212 | 212 | ||
213 | irdaactive = checkIrdaStatus(); | 213 | irdaactive = checkIrdaStatus(); |
214 | irdaDiscoveryActive = checkIrdaDiscoveryStatus(); | 214 | irdaDiscoveryActive = checkIrdaDiscoveryStatus(); |
215 | 215 | ||
216 | if ((irdaactive != oldactive) || (irdaDiscoveryActive != olddiscovery) || receiveUpdate ) { | 216 | if ((irdaactive != oldactive) || (irdaDiscoveryActive != olddiscovery) || receiveUpdate ) { |
217 | paintEvent(NULL); | 217 | paintEvent(NULL); |
218 | } | 218 | } |
219 | 219 | ||
220 | } | 220 | } |
221 | 221 | ||
222 | void IrdaApplet::paintEvent( QPaintEvent* ) { | 222 | void IrdaApplet::paintEvent( QPaintEvent* ) { |
diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h index 97ca3c3..002d295 100644 --- a/core/applets/irdaapplet/irda.h +++ b/core/applets/irdaapplet/irda.h | |||
@@ -22,42 +22,42 @@ | |||
22 | #include <qpixmap.h> | 22 | #include <qpixmap.h> |
23 | #include <qguardedptr.h> | 23 | #include <qguardedptr.h> |
24 | #include <qtimer.h> | 24 | #include <qtimer.h> |
25 | #include <qfile.h> | 25 | #include <qfile.h> |
26 | 26 | ||
27 | 27 | ||
28 | class IrdaApplet : public QWidget | 28 | class IrdaApplet : public QWidget |
29 | { | 29 | { |
30 | Q_OBJECT | 30 | Q_OBJECT |
31 | public: | 31 | public: |
32 | IrdaApplet( QWidget *parent = 0, const char *name=0 ); | 32 | IrdaApplet( QWidget *parent = 0, const char *name=0 ); |
33 | ~IrdaApplet(); | 33 | ~IrdaApplet(); |
34 | 34 | ||
35 | protected: | 35 | protected: |
36 | void timerEvent(QTimerEvent *te ); | 36 | void timerEvent(QTimerEvent *te ); |
37 | 37 | ||
38 | private: | 38 | private: |
39 | void mousePressEvent( QMouseEvent * ); | 39 | void mousePressEvent( QMouseEvent * ); |
40 | void paintEvent( QPaintEvent* ); | 40 | void paintEvent( QPaintEvent* ); |
41 | int checkIrdaStatus(); | 41 | int checkIrdaStatus(); |
42 | int setIrdaStatus(int); | 42 | int setIrdaStatus(int); |
43 | int checkIrdaDiscoveryStatus(); | 43 | int checkIrdaDiscoveryStatus(); |
44 | int setIrdaDiscoveryStatus(int); | 44 | int setIrdaDiscoveryStatus(int); |
45 | int sockfd; | 45 | int sockfd; |
46 | 46 | ||
47 | private: | 47 | private: |
48 | QPixmap irdaOnPixmap; | 48 | QPixmap irdaOnPixmap; |
49 | QPixmap irdaOffPixmap; | 49 | QPixmap irdaOffPixmap; |
50 | QPixmap irdaDiscoveryOnPixmap; | 50 | QPixmap irdaDiscoveryOnPixmap; |
51 | QPixmap receiveActivePixmap; | 51 | QPixmap receiveActivePixmap; |
52 | int irdaactive; // bool and bitfields later bool irdaactive :1 ; | 52 | int irdaactive; // bool and bitfields later bool irdaactive :1 ; |
53 | int irdaDiscoveryActive; | 53 | int irdaDiscoveryActive; |
54 | bool receiveActive; | 54 | bool receiveActive : 1; |
55 | bool receiveStateChanged; | 55 | bool receiveStateChanged; |
56 | private slots: | 56 | private slots: |
57 | 57 | ||
58 | 58 | ||
59 | }; | 59 | }; |
60 | 60 | ||
61 | 61 | ||
62 | #endif // __SCREENSHOT_APPLET_H__ | 62 | #endif // __SCREENSHOT_APPLET_H__ |
63 | 63 | ||