summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-28 14:46:42 (UTC)
committer zecke <zecke>2003-08-28 14:46:42 (UTC)
commit285e7737f47c508ee816c5a96ebfc4207dc78438 (patch) (side-by-side diff)
tree195ec4cee2dc4330dab6abb935edeecfd52ec8ad
parentb2929c823a2ec7d64b879266bebf2c648753c995 (diff)
downloadopie-285e7737f47c508ee816c5a96ebfc4207dc78438.zip
opie-285e7737f47c508ee816c5a96ebfc4207dc78438.tar.gz
opie-285e7737f47c508ee816c5a96ebfc4207dc78438.tar.bz2
Use /proc/fstab
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/stabmon.cpp20
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,8 +1,8 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
@@ -20,15 +20,19 @@
#include "stabmon.h"
-#include <qpe/qcopenvelope_qws.h>
+#ifdef QWS
+#include <qtopia/qcopenvelope_qws.h>
+#endif
#include <qfile.h>
#include <qcstring.h>
#include <sys/stat.h>
+#if defined(Q_OS_LINUX) || defined(_OS_LINUX_)
#include <unistd.h>
+#endif
#include <stdlib.h>
SysFileMonitor::SysFileMonitor(QObject* parent) :
QObject(parent)
@@ -58,13 +62,15 @@ void SysFileMonitor::timerEvent(QTimerEvent*)
last[i] = (long)s.st_mtime;
ch=TRUE;
}
if ( ch ) {
+#ifndef QT_NO_COP
QCopEnvelope("QPE/Card", "stabChanged()" );
+#endif
break;
}
}
-
+
// st_size is no use, it's 0 for /proc/mounts too. Read it all.
static int mtabSize = 0;
QFile f( "/proc/mounts" );
if ( f.open(IO_ReadOnly) ) {
@@ -72,9 +78,11 @@ void SysFileMonitor::timerEvent(QTimerEvent*)
// readAll does not work correctly on sequential devices (as eg. /proc files)
QByteArray ba = f.readAll();
if ( (int)ba.size() != mtabSize ) {
mtabSize = (int)ba.size();
+#ifndef QT_NO_COP
QCopEnvelope("QPE/Card", "mtabChanged()" );
+#endif
}
#else
QString s;
while( !f.atEnd() ) {
@@ -83,10 +91,12 @@ void SysFileMonitor::timerEvent(QTimerEvent*)
s += tmp;
}
if ( (int)s.length() != mtabSize ) {
mtabSize = (int)s.length();
+#ifndef QT_NO_COP
QCopEnvelope("QPE/Card", "mtabChanged()" );
+#endif
}
-#endif
+#endif
}
}