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, 1 insertions, 1 deletions
diff --git a/library/storage.cpp b/library/storage.cpp
index 937908d..3668d29 100644
--- a/library/storage.cpp
+++ b/library/storage.cpp
@@ -1,71 +1,71 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org> 2** Copyright (C) Holger 'zecke' Freyther <freyther@kde.org>
3** Copyright (C) 2000 Trolltech AS. All rights reserved. 3** Copyright (C) 2000 Trolltech AS. All rights reserved.
4** 4**
5** This file is part of Qtopia Environment. 5** This file is part of Qtopia Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include <qpe/storage.h> 22#include <qpe/storage.h>
23#ifdef QT_QWS_CUSTOM 23#ifdef QT_QWS_SHARP
24#include <qpe/custom.h> 24#include <qpe/custom.h>
25#endif 25#endif
26 26
27#include <qfile.h> 27#include <qfile.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qcopchannel_qws.h> 29#include <qcopchannel_qws.h>
30 30
31#include <stdio.h> 31#include <stdio.h>
32 32
33#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 33#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
34#include <sys/vfs.h> 34#include <sys/vfs.h>
35#include <mntent.h> 35#include <mntent.h>
36#endif 36#endif
37 37
38#include <qstringlist.h> 38#include <qstringlist.h>
39 39
40static bool isCF(const QString& m) 40static bool isCF(const QString& m)
41{ 41{
42 FILE* f = fopen("/var/run/stab", "r"); 42 FILE* f = fopen("/var/run/stab", "r");
43 if (!f) f = fopen("/var/state/pcmcia/stab", "r"); 43 if (!f) f = fopen("/var/state/pcmcia/stab", "r");
44 if (!f) f = fopen("/var/lib/pcmcia/stab", "r"); 44 if (!f) f = fopen("/var/lib/pcmcia/stab", "r");
45 if ( f ) { 45 if ( f ) {
46 char line[1024]; 46 char line[1024];
47 char devtype[80]; 47 char devtype[80];
48 char devname[80]; 48 char devname[80];
49 while ( fgets( line, 1024, f ) ) { 49 while ( fgets( line, 1024, f ) ) {
50 // 0 ide ide-cs 0 hda 3 0 50 // 0 ide ide-cs 0 hda 3 0
51 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 ) 51 if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 )
52 { 52 {
53 if ( QString(devtype) == "ide" && m.find(devname)>0 ) { 53 if ( QString(devtype) == "ide" && m.find(devname)>0 ) {
54 fclose(f); 54 fclose(f);
55 return TRUE; 55 return TRUE;
56 } 56 }
57 } 57 }
58 } 58 }
59 fclose(f); 59 fclose(f);
60 } 60 }
61 return FALSE; 61 return FALSE;
62} 62}
63 63
64StorageInfo::StorageInfo( QObject *parent ) 64StorageInfo::StorageInfo( QObject *parent )
65 : QObject( parent ) 65 : QObject( parent )
66{ 66{
67 mFileSystems.setAutoDelete( TRUE ); 67 mFileSystems.setAutoDelete( TRUE );
68 channel = new QCopChannel( "QPE/Card", this ); 68 channel = new QCopChannel( "QPE/Card", this );
69 connect( channel, SIGNAL(received(const QCString &, const QByteArray &)), 69 connect( channel, SIGNAL(received(const QCString &, const QByteArray &)),
70 this, SLOT(cardMessage( const QCString &, const QByteArray &)) ); 70 this, SLOT(cardMessage( const QCString &, const QByteArray &)) );
71 update(); 71 update();