author | mickeyl <mickeyl> | 2003-12-06 16:21:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-06 16:21:35 (UTC) |
commit | 2d793ca674944241480f6939814e3f61d0a0e0fb (patch) (side-by-side diff) | |
tree | b5b99750e52557185592601eff8c4776fbd70c00 | |
parent | efb9bf44691e6555a45f0a45f570eb56f1b180d3 (diff) | |
download | opie-2d793ca674944241480f6939814e3f61d0a0e0fb.zip opie-2d793ca674944241480f6939814e3f61d0a0e0fb.tar.gz opie-2d793ca674944241480f6939814e3f61d0a0e0fb.tar.bz2 |
fix display bug for usage column
-rw-r--r-- | noncore/settings/sysinfo/modulesinfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp index 8def0d6..0bf51e8 100644 --- a/noncore/settings/sysinfo/modulesinfo.cpp +++ b/noncore/settings/sysinfo/modulesinfo.cpp @@ -83,64 +83,66 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) updateData(); ModulesDtl = new Detail(); QWhatsThis::add( ModulesDtl->detailView, tr( "This area shows detailed information about this module." ) ); } ModulesInfo::~ModulesInfo() { } void ModulesInfo::updateData() { char modname[64]; char usage[200]; int modsize, usecount; QString selectedmod; QListViewItem *curritem = ModulesView->currentItem(); if ( curritem ) { selectedmod = curritem->text( 0 ); } ModulesView->clear(); FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r"); if ( procfile ) { QListViewItem *newitem; QListViewItem *selecteditem = 0x0; while ( true ) { + modname[0] = '\0'; + usage[0] = '\0'; int success = fscanf( procfile, "%s%d%d%[^\n]", modname, &modsize, &usecount, usage ); if ( success == EOF ) break; QString qmodname = QString( modname ); QString qmodsize = QString::number( modsize ).rightJustify( 6, ' ' ); QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' ); QString qusage = QString( usage ); newitem = new QListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage ); if ( qmodname == selectedmod ) { selecteditem = newitem; } } ModulesView->setCurrentItem( selecteditem ); fclose( procfile ); } } void ModulesInfo::slotSendClicked() { if ( !ModulesView->currentItem() ) { return; } QString capstr = tr( "You really want to execute %1 for this module?" ).arg( CommandCB->currentText() ); QString modname = ModulesView->currentItem()->text( 0 ); |