Diffstat (limited to 'noncore/settings/sysinfo/devicesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/devicesinfo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp index 164d608..428cfd4 100644 --- a/noncore/settings/sysinfo/devicesinfo.cpp +++ b/noncore/settings/sysinfo/devicesinfo.cpp | |||
@@ -244,49 +244,49 @@ void UsbCategory::populate() | |||
244 | int usbcount = 0; | 244 | int usbcount = 0; |
245 | UsbDevice* lastDev = 0; | 245 | UsbDevice* lastDev = 0; |
246 | UsbDevice* dev = 0; | 246 | UsbDevice* dev = 0; |
247 | while ( !usbinfo.atEnd() ) | 247 | while ( !usbinfo.atEnd() ) |
248 | { | 248 | { |
249 | QString line = usbinfo.readLine(); | 249 | QString line = usbinfo.readLine(); |
250 | odebug << "got line '" << line << "'" << oendl; | 250 | odebug << "got line '" << line << "'" << oendl; |
251 | if ( line.startsWith( "T:" ) ) | 251 | if ( line.startsWith( "T:" ) ) |
252 | { | 252 | { |
253 | sscanf(line.local8Bit().data(), "T: Bus=%2d Lev=%2d Prnt=%2d Port=%d Cnt=%2d Dev#=%3d Spd=%3f MxCh=%2d", &_bus, &_level, &_parent, &_port, &_count, &_device, &_speed, &_channels); | 253 | sscanf(line.local8Bit().data(), "T: Bus=%2d Lev=%2d Prnt=%2d Port=%d Cnt=%2d Dev#=%3d Spd=%3f MxCh=%2d", &_bus, &_level, &_parent, &_port, &_count, &_device, &_speed, &_channels); |
254 | 254 | ||
255 | if ( !_level ) | 255 | if ( !_level ) |
256 | { | 256 | { |
257 | odebug << "adding new bus" << oendl; | 257 | odebug << "adding new bus" << oendl; |
258 | dev = new UsbDevice( this, QString( "Generic USB Hub Device" ) ); | 258 | dev = new UsbDevice( this, QString( "Generic USB Hub Device" ) ); |
259 | lastDev = dev; | 259 | lastDev = dev; |
260 | } | 260 | } |
261 | else | 261 | else |
262 | { | 262 | { |
263 | odebug << "adding new dev" << oendl; | 263 | odebug << "adding new dev" << oendl; |
264 | dev = new UsbDevice( lastDev, QString( "Generic USB Hub Device" ) ); | 264 | dev = new UsbDevice( lastDev, QString( "Generic USB Hub Device" ) ); |
265 | lastDev = dev; | 265 | lastDev = dev; |
266 | } | 266 | } |
267 | } | 267 | } |
268 | else if ( line.startsWith( "S: Product" ) ) | 268 | else if ( dev && line.startsWith( "S: Product" ) ) |
269 | { | 269 | { |
270 | int dp = line.find( '=' ); | 270 | int dp = line.find( '=' ); |
271 | dev->setText( 0, dp != -1 ? line.right( line.length()-1-dp ) : "<unknown>" ); | 271 | dev->setText( 0, dp != -1 ? line.right( line.length()-1-dp ) : "<unknown>" ); |
272 | } | 272 | } |
273 | else | 273 | else |
274 | { | 274 | { |
275 | continue; | 275 | continue; |
276 | } | 276 | } |
277 | } | 277 | } |
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
281 | //================================================================================================= | 281 | //================================================================================================= |
282 | Device::Device( Category* parent, const QString& name ) | 282 | Device::Device( Category* parent, const QString& name ) |
283 | :OListViewItem( parent, name ) | 283 | :OListViewItem( parent, name ) |
284 | { | 284 | { |
285 | devinfo = static_cast<QWidget*>( listView()->parent() ); | 285 | devinfo = static_cast<QWidget*>( listView()->parent() ); |
286 | } | 286 | } |
287 | 287 | ||
288 | Device::Device( Device* parent, const QString& name ) | 288 | Device::Device( Device* parent, const QString& name ) |
289 | :OListViewItem( parent, name ) | 289 | :OListViewItem( parent, name ) |
290 | { | 290 | { |
291 | devinfo = static_cast<QWidget*>( listView()->parent() ); | 291 | devinfo = static_cast<QWidget*>( listView()->parent() ); |
292 | } | 292 | } |