author | zecke <zecke> | 2003-08-28 14:46:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-28 14:46:42 (UTC) |
commit | 285e7737f47c508ee816c5a96ebfc4207dc78438 (patch) (unidiff) | |
tree | 195ec4cee2dc4330dab6abb935edeecfd52ec8ad /core | |
parent | b2929c823a2ec7d64b879266bebf2c648753c995 (diff) | |
download | opie-285e7737f47c508ee816c5a96ebfc4207dc78438.zip opie-285e7737f47c508ee816c5a96ebfc4207dc78438.tar.gz opie-285e7737f47c508ee816c5a96ebfc4207dc78438.tar.bz2 |
Use /proc/fstab
-rw-r--r-- | core/launcher/stabmon.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/launcher/stabmon.cpp b/core/launcher/stabmon.cpp index 3d0d534..4e5f290 100644 --- a/core/launcher/stabmon.cpp +++ b/core/launcher/stabmon.cpp | |||
@@ -1,7 +1,7 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of 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 |
@@ -21,13 +21,17 @@ | |||
21 | 21 | ||
22 | #include "stabmon.h" | 22 | #include "stabmon.h" |
23 | 23 | ||
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #ifdef QWS |
25 | #include <qtopia/qcopenvelope_qws.h> | ||
26 | #endif | ||
25 | 27 | ||
26 | #include <qfile.h> | 28 | #include <qfile.h> |
27 | #include <qcstring.h> | 29 | #include <qcstring.h> |
28 | 30 | ||
29 | #include <sys/stat.h> | 31 | #include <sys/stat.h> |
32 | #if defined(Q_OS_LINUX) || defined(_OS_LINUX_) | ||
30 | #include <unistd.h> | 33 | #include <unistd.h> |
34 | #endif | ||
31 | #include <stdlib.h> | 35 | #include <stdlib.h> |
32 | 36 | ||
33 | SysFileMonitor::SysFileMonitor(QObject* parent) : | 37 | SysFileMonitor::SysFileMonitor(QObject* parent) : |
@@ -59,11 +63,13 @@ void SysFileMonitor::timerEvent(QTimerEvent*) | |||
59 | ch=TRUE; | 63 | ch=TRUE; |
60 | } | 64 | } |
61 | if ( ch ) { | 65 | if ( ch ) { |
66 | #ifndef QT_NO_COP | ||
62 | QCopEnvelope("QPE/Card", "stabChanged()" ); | 67 | QCopEnvelope("QPE/Card", "stabChanged()" ); |
68 | #endif | ||
63 | break; | 69 | break; |
64 | } | 70 | } |
65 | } | 71 | } |
66 | 72 | ||
67 | // st_size is no use, it's 0 for /proc/mounts too. Read it all. | 73 | // st_size is no use, it's 0 for /proc/mounts too. Read it all. |
68 | static int mtabSize = 0; | 74 | static int mtabSize = 0; |
69 | QFile f( "/proc/mounts" ); | 75 | QFile f( "/proc/mounts" ); |
@@ -73,7 +79,9 @@ void SysFileMonitor::timerEvent(QTimerEvent*) | |||
73 | QByteArray ba = f.readAll(); | 79 | QByteArray ba = f.readAll(); |
74 | if ( (int)ba.size() != mtabSize ) { | 80 | if ( (int)ba.size() != mtabSize ) { |
75 | mtabSize = (int)ba.size(); | 81 | mtabSize = (int)ba.size(); |
82 | #ifndef QT_NO_COP | ||
76 | QCopEnvelope("QPE/Card", "mtabChanged()" ); | 83 | QCopEnvelope("QPE/Card", "mtabChanged()" ); |
84 | #endif | ||
77 | } | 85 | } |
78 | #else | 86 | #else |
79 | QString s; | 87 | QString s; |
@@ -84,9 +92,11 @@ void SysFileMonitor::timerEvent(QTimerEvent*) | |||
84 | } | 92 | } |
85 | if ( (int)s.length() != mtabSize ) { | 93 | if ( (int)s.length() != mtabSize ) { |
86 | mtabSize = (int)s.length(); | 94 | mtabSize = (int)s.length(); |
95 | #ifndef QT_NO_COP | ||
87 | QCopEnvelope("QPE/Card", "mtabChanged()" ); | 96 | QCopEnvelope("QPE/Card", "mtabChanged()" ); |
97 | #endif | ||
88 | } | 98 | } |
89 | #endif | 99 | #endif |
90 | } | 100 | } |
91 | } | 101 | } |
92 | 102 | ||