-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 | |||
@@ -27,12 +27,13 @@ _;:, .> :=|. This program is free software; you can | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "devicesinfo.h" | 29 | #include "devicesinfo.h" |
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | #include <opie2/odebug.h> | 31 | #include <opie2/odebug.h> |
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> |
34 | #include <opie2/olistview.h> | 35 | #include <opie2/olistview.h> |
35 | #include <qpe/qpeapplication.h> | 36 | #include <qpe/qpeapplication.h> |
36 | using namespace Opie::Core; | 37 | using namespace Opie::Core; |
37 | using namespace Opie::Ui; | 38 | using namespace Opie::Ui; |
38 | 39 | ||
@@ -182,14 +183,13 @@ void InputCategory::populate() | |||
182 | { | 183 | { |
183 | odebug << "InputCategory::populate()" << oendl; | 184 | odebug << "InputCategory::populate()" << oendl; |
184 | OInputSystem* sys = OInputSystem::instance(); | 185 | OInputSystem* sys = OInputSystem::instance(); |
185 | OInputSystem::DeviceIterator it = sys->iterator(); | 186 | OInputSystem::DeviceIterator it = sys->iterator(); |
186 | while ( it.current() ) | 187 | while ( it.current() ) |
187 | { | 188 | { |
188 | OInputDevice* dev = it.current(); | 189 | new InputDevice( this, it.current()->identity() ); |
189 | new InputDevice( this, dev->identity() ); | ||
190 | ++it; | 190 | ++it; |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | //================================================================================================= | 194 | //================================================================================================= |
195 | CardsCategory::CardsCategory( DevicesView* parent ) | 195 | CardsCategory::CardsCategory( DevicesView* parent ) |
@@ -201,35 +201,18 @@ CardsCategory::~CardsCategory() | |||
201 | { | 201 | { |
202 | } | 202 | } |
203 | 203 | ||
204 | void CardsCategory::populate() | 204 | void CardsCategory::populate() |
205 | { | 205 | { |
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 | { | 210 | { |
220 | QString line = cardinfo.readLine(); | 211 | new CardDevice( this, (const char*) it.currentKey() ); |
221 | odebug << "got line '" << line << "'" << oendl; | 212 | ++it; |
222 | if ( line.startsWith( "Socket" ) ) | ||
223 | { | ||
224 | new CardDevice( this, line ); | ||
225 | } | ||
226 | else | ||
227 | { | ||
228 | continue; | ||
229 | } | ||
230 | } | 213 | } |
231 | } | 214 | } |
232 | 215 | ||
233 | //================================================================================================= | 216 | //================================================================================================= |
234 | UsbCategory::UsbCategory( DevicesView* parent ) | 217 | UsbCategory::UsbCategory( DevicesView* parent ) |
235 | :Category( parent, "4. Universal Serial Bus" ) | 218 | :Category( parent, "4. Universal Serial Bus" ) |