Diffstat (limited to 'noncore/applets/memoryapplet/swapfile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp index 9416db3..a71078f 100644 --- a/noncore/applets/memoryapplet/swapfile.cpp +++ b/noncore/applets/memoryapplet/swapfile.cpp | |||
@@ -11,45 +11,50 @@ | |||
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 "swapfile.h" | 21 | #include "swapfile.h" |
22 | 22 | ||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | #include <qpe/resource.h> | ||
26 | using namespace Opie::Core; | ||
27 | |||
28 | /* QT */ | ||
23 | #include <qfile.h> | 29 | #include <qfile.h> |
24 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
25 | #include <qlabel.h> | 31 | #include <qlabel.h> |
26 | #include <qtimer.h> | 32 | #include <qtimer.h> |
27 | #include <qlayout.h> | 33 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
29 | #include <qhbuttongroup.h> | 35 | #include <qhbuttongroup.h> |
30 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
31 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
32 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
33 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
34 | #include <qvgroupbox.h> | 40 | #include <qvgroupbox.h> |
35 | #include <qhbox.h> | 41 | #include <qhbox.h> |
36 | #include <qmessagebox.h> | 42 | #include <qmessagebox.h> |
43 | #include <qcopchannel_qws.h> | ||
44 | |||
45 | /* STD */ | ||
37 | #include <stdio.h> | 46 | #include <stdio.h> |
38 | #include <stdlib.h> | 47 | #include <stdlib.h> |
39 | #include <string.h> | 48 | #include <string.h> |
40 | |||
41 | #include <qcopchannel_qws.h> | ||
42 | #include <qpe/resource.h> | ||
43 | |||
44 | #include <unistd.h> | 49 | #include <unistd.h> |
45 | #include <fcntl.h> | 50 | #include <fcntl.h> |
46 | #include <sys/vfs.h> | 51 | #include <sys/vfs.h> |
47 | #include <mntent.h> | 52 | #include <mntent.h> |
48 | #include <unistd.h> | 53 | #include <unistd.h> |
49 | #include <sys/types.h> | 54 | #include <sys/types.h> |
50 | 55 | ||
51 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) | 56 | Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) |
52 | : QWidget( parent, name, f ) | 57 | : QWidget( parent, name, f ) |
53 | { | 58 | { |
54 | // are we running as root? | 59 | // are we running as root? |
55 | isRoot = geteuid() == 0; | 60 | isRoot = geteuid() == 0; |
@@ -204,25 +209,25 @@ void Swapfile::getStatusPcmcia() | |||
204 | 209 | ||
205 | if (cardWas1 != cardInPcmcia1) { | 210 | if (cardWas1 != cardInPcmcia1) { |
206 | if (cardInPcmcia1) { | 211 | if (cardInPcmcia1) { |
207 | cfRB->setEnabled(TRUE); | 212 | cfRB->setEnabled(TRUE); |
208 | } else { | 213 | } else { |
209 | cfRB->setChecked(FALSE); | 214 | cfRB->setChecked(FALSE); |
210 | cfRB->setEnabled(FALSE); | 215 | cfRB->setEnabled(FALSE); |
211 | } | 216 | } |
212 | } | 217 | } |
213 | } | 218 | } |
214 | } else { | 219 | } else { |
215 | // no file found | 220 | // no file found |
216 | qDebug("no file found"); | 221 | odebug << "no file found" << oendl; |
217 | cardInPcmcia0 = FALSE; | 222 | cardInPcmcia0 = FALSE; |
218 | cardInPcmcia1 = FALSE; | 223 | cardInPcmcia1 = FALSE; |
219 | } | 224 | } |
220 | Swapfile::cfsdchecked(); | 225 | Swapfile::cfsdchecked(); |
221 | } | 226 | } |
222 | 227 | ||
223 | 228 | ||
224 | void Swapfile::getStatusSd() | 229 | void Swapfile::getStatusSd() |
225 | { | 230 | { |
226 | 231 | ||
227 | bool cardWas = cardInSd;// remember last state | 232 | bool cardWas = cardInSd;// remember last state |
228 | cardInSd = FALSE; | 233 | cardInSd = FALSE; |