summaryrefslogtreecommitdiff
path: root/library/storage.cpp
Unidiff
Diffstat (limited to 'library/storage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/storage.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/library/storage.cpp b/library/storage.cpp
index 1ce43bc..dc5cc22 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -1,74 +1,72 @@
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#if defined(QT_QWS_SL5XXX)
25#include <qpe/custom.h> 24#include <qpe/custom.h>
26#endif
27 25
28#include <qfile.h> 26#include <qfile.h>
29#include <qtimer.h> 27#include <qtimer.h>
30#include <qcopchannel_qws.h> 28#include <qcopchannel_qws.h>
31 29
32#include <stdio.h> 30#include <stdio.h>
33 31
34#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 32#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
35#include <sys/vfs.h> 33#include <sys/vfs.h>
36#include <mntent.h> 34#include <mntent.h>
37#endif 35#endif
38 36
39#include <qstringlist.h> 37#include <qstringlist.h>
40 38
41#include <sys/vfs.h> 39#include <sys/vfs.h>
42#include <mntent.h> 40#include <mntent.h>
43 41
44 42
45static bool isCF(const QString& m) 43static bool isCF(const QString& m)
46{ 44{
47 FILE* f = fopen("/var/run/stab", "r"); 45 FILE* f = fopen("/var/run/stab", "r");
48 if (!f) f = fopen("/var/state/pcmcia/stab", "r"); 46 if (!f) f = fopen("/var/state/pcmcia/stab", "r");
49 if (!f) f = fopen("/var/lib/pcmcia/stab", "r"); 47 if (!f) f = fopen("/var/lib/pcmcia/stab", "r");
50 if ( f ) { 48 if ( f ) {
51 char line[1024]; 49 char line[1024];
52 char devtype[80]; 50 char devtype[80];
53 char devname[80]; 51 char devname[80];
54 while ( fgets( line, 1024, f ) ) { 52 while ( fgets( line, 1024, f ) ) {
55 // 0 ide ide-cs 0 hda 3 0 53 // 0 ide ide-cs 0 hda 3 0
56 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 ) 54 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 )
57 { 55 {
58 if ( QString(devtype) == "ide" && m.find(devname)>0 ) { 56 if ( QString(devtype) == "ide" && m.find(devname)>0 ) {
59 fclose(f); 57 fclose(f);
60 return TRUE; 58 return TRUE;
61 } 59 }
62 } 60 }
63 } 61 }
64 fclose(f); 62 fclose(f);
65 } 63 }
66 return FALSE; 64 return FALSE;
67} 65}
68 66
69/*! \class StorageInfo storage.h 67/*! \class StorageInfo storage.h
70 \brief The StorageInfo class describes the disks mounted on the file system. 68 \brief The StorageInfo class describes the disks mounted on the file system.
71 69
72 This class provides access to the mount information for the Linux 70 This class provides access to the mount information for the Linux
73 filesystem. Each mount point is represented by the FileSystem class. 71 filesystem. Each mount point is represented by the FileSystem class.
74 To ensure this class has the most up to date size information, call 72 To ensure this class has the most up to date size information, call