author | mickeyl <mickeyl> | 2005-05-19 11:59:50 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-05-19 11:59:50 (UTC) |
commit | cdecf5d75233150cba06094262158fb218e9bf03 (patch) (unidiff) | |
tree | 7cd9a17fc2eb820638e73945454b02c07a927520 | |
parent | ed7ba8b228d3d0ffae9c9b68900b7f723d7ade4a (diff) | |
download | opie-cdecf5d75233150cba06094262158fb218e9bf03.zip opie-cdecf5d75233150cba06094262158fb218e9bf03.tar.gz opie-cdecf5d75233150cba06094262158fb218e9bf03.tar.bz2 |
use OPcmciaSystem
-rw-r--r-- | noncore/settings/sysinfo/devicesinfo.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp index 7e8aee8..945edea 100644 --- a/noncore/settings/sysinfo/devicesinfo.cpp +++ b/noncore/settings/sysinfo/devicesinfo.cpp | |||
@@ -32,2 +32,3 @@ _;:, .> :=|. This program is free software; you can | |||
32 | #include <opie2/oinputsystem.h> | 32 | #include <opie2/oinputsystem.h> |
33 | #include <opie2/opcmciasystem.h> | ||
33 | #include <opie2/olayout.h> | 34 | #include <opie2/olayout.h> |
@@ -187,4 +188,3 @@ void InputCategory::populate() | |||
187 | { | 188 | { |
188 | OInputDevice* dev = it.current(); | 189 | new InputDevice( this, it.current()->identity() ); |
189 | new InputDevice( this, dev->identity() ); | ||
190 | ++it; | 190 | ++it; |
@@ -206,25 +206,8 @@ void CardsCategory::populate() | |||
206 | odebug << "CardsCategory::populate()" << oendl; | 206 | odebug << "CardsCategory::populate()" << oendl; |
207 | QString fileName; | 207 | OPcmciaSystem* sys = OPcmciaSystem::instance(); |
208 | if ( QFile::exists( "/var/run/stab" ) ) { fileName = "/var/run/stab"; } | 208 | OPcmciaSystem::CardIterator it = sys->iterator(); |
209 | else if ( QFile::exists( "/var/state/pcmcia/stab" ) ) { fileName = "/var/state/pcmcia/stab"; } | 209 | while ( it.current() ) |
210 | else { fileName = "/var/lib/pcmcia/stab"; } | ||
211 | QFile cardinfofile( fileName ); | ||
212 | if ( !cardinfofile.exists() || !cardinfofile.open( IO_ReadOnly ) ) | ||
213 | { | ||
214 | new CardDevice( this, "ERROR: pcmcia info file not found or unaccessible" ); | ||
215 | return; | ||
216 | } | ||
217 | QTextStream cardinfo( &cardinfofile ); | ||
218 | while ( !cardinfo.atEnd() ) | ||
219 | { | ||
220 | QString line = cardinfo.readLine(); | ||
221 | odebug << "got line '" << line << "'" << oendl; | ||
222 | if ( line.startsWith( "Socket" ) ) | ||
223 | { | ||
224 | new CardDevice( this, line ); | ||
225 | } | ||
226 | else | ||
227 | { | 210 | { |
228 | continue; | 211 | new CardDevice( this, (const char*) it.currentKey() ); |
229 | } | 212 | ++it; |
230 | } | 213 | } |