summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/irdaapplet/irda.cpp8
-rw-r--r--core/applets/irdaapplet/irda.h2
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
@@ -156,59 +156,59 @@ void IrdaApplet::mousePressEvent( QMouseEvent *) {
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
203void IrdaApplet::timerEvent( QTimerEvent * ) { 203void 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();
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
@@ -30,34 +30,34 @@ class IrdaApplet : public QWidget
30 Q_OBJECT 30 Q_OBJECT
31public: 31public:
32 IrdaApplet( QWidget *parent = 0, const char *name=0 ); 32 IrdaApplet( QWidget *parent = 0, const char *name=0 );
33 ~IrdaApplet(); 33 ~IrdaApplet();
34 34
35protected: 35protected:
36 void timerEvent(QTimerEvent *te ); 36 void timerEvent(QTimerEvent *te );
37 37
38private: 38private:
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
47private: 47private:
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;
56private slots: 56private slots:
57 57
58 58
59}; 59};
60 60
61 61
62#endif // __SCREENSHOT_APPLET_H__ 62#endif // __SCREENSHOT_APPLET_H__
63 63