summaryrefslogtreecommitdiff
path: root/library/storage.cpp
authorchicken <chicken>2004-03-01 18:10:37 (UTC)
committer chicken <chicken>2004-03-01 18:10:37 (UTC)
commit7fd20d139e2d9bc37ce22bbdb07f4ebc54903f91 (patch) (unidiff)
tree15ef5e3d00c5476ea98ca36ba6c8392eb02e53c8 /library/storage.cpp
parent5b4e342004537f84fa53911a46cd00d810378da7 (diff)
downloadopie-7fd20d139e2d9bc37ce22bbdb07f4ebc54903f91.zip
opie-7fd20d139e2d9bc37ce22bbdb07f4ebc54903f91.tar.gz
opie-7fd20d139e2d9bc37ce22bbdb07f4ebc54903f91.tar.bz2
fix includes
Diffstat (limited to 'library/storage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/storage.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/library/storage.cpp b/library/storage.cpp
index d98139b..0ea465b 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -1,69 +1,65 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org> 2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org>
3** Copyright (C) Lorn Potter <llornkcor@handhelds.org> 3** Copyright (C) Lorn Potter <llornkcor@handhelds.org>
4** Copyright (C) 2000 Trolltech AS. All rights reserved. 4** Copyright (C) 2000 Trolltech AS. All rights reserved.
5** 5**
6** This file is part of Opie Environment. 6** This file is part of Opie Environment.
7** 7**
8** This file may be distributed and/or modified under the terms of the 8** This file may be distributed and/or modified under the terms of the
9** GNU General Public License version 2 as published by the Free Software 9** GNU General Public License version 2 as published by the Free Software
10** Foundation and appearing in the file LICENSE.GPL included in the 10** Foundation and appearing in the file LICENSE.GPL included in the
11** packaging of this file. 11** packaging of this file.
12** 12**
13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15** 15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information. 16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17** 17**
18** Contact info@trolltech.com if any conditions of this licensing are 18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you. 19** not clear to you.
20** 20**
21**********************************************************************/ 21**********************************************************************/
22 22
23#include <qpe/storage.h> 23#include <qpe/storage.h>
24#include <qpe/custom.h>
25 24
26#include <qfile.h>
27#include <qtimer.h>
28#include <qcopchannel_qws.h> 25#include <qcopchannel_qws.h>
29 26
30#include <stdio.h> 27#include <stdio.h>
31 28
32#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 29#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
33#include <sys/vfs.h> 30#include <sys/vfs.h>
34#include <mntent.h> 31#include <mntent.h>
35#endif 32#endif
36 33
37#ifdef Q_OS_MACX 34#ifdef Q_OS_MACX
38# include <sys/param.h> 35# include <sys/param.h>
39# include <sys/ucred.h> 36# include <sys/ucred.h>
40# include <sys/mount.h> 37# include <sys/mount.h>
41# include <stdio.h> // For strerror() 38# include <stdio.h> // For strerror()
42# include <errno.h> 39# include <errno.h>
43#endif /* Q_OS_MACX */ 40#endif /* Q_OS_MACX */
44 41
45#include <qstringlist.h>
46 42
47// Shouldn't be here ! (eilers) 43// Shouldn't be here ! (eilers)
48// #include <sys/vfs.h> 44// #include <sys/vfs.h>
49// #include <mntent.h> 45// #include <mntent.h>
50 46
51 47
52static bool isCF(const QString& m) 48static bool isCF(const QString& m)
53{ 49{
54 50
55#ifndef Q_OS_MACX 51#ifndef Q_OS_MACX
56 FILE* f = fopen("/var/run/stab", "r"); 52 FILE* f = fopen("/var/run/stab", "r");
57 if (!f) f = fopen("/var/state/pcmcia/stab", "r"); 53 if (!f) f = fopen("/var/state/pcmcia/stab", "r");
58 if (!f) f = fopen("/var/lib/pcmcia/stab", "r"); 54 if (!f) f = fopen("/var/lib/pcmcia/stab", "r");
59 if ( f ) 55 if ( f )
60 { 56 {
61 char line[1024]; 57 char line[1024];
62 char devtype[80]; 58 char devtype[80];
63 char devname[80]; 59 char devname[80];
64 while ( fgets( line, 1024, f ) ) 60 while ( fgets( line, 1024, f ) )
65 { 61 {
66 // 0 ide ide-cs 0 hda 3 0 62 // 0 ide ide-cs 0 hda 3 0
67 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 ) 63 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 )
68 { 64 {
69 if ( QString(devtype) == "ide" && m.find(devname)>0 ) 65 if ( QString(devtype) == "ide" && m.find(devname)>0 )