Diffstat (limited to 'noncore/settings/sysinfo/storage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp index c4474d5..4ef7122 100644 --- a/noncore/settings/sysinfo/storage.cpp +++ b/noncore/settings/sysinfo/storage.cpp @@ -51,5 +51,5 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) storage = new StorageInfo( this ); connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); - + lines.setAutoDelete(TRUE); @@ -59,4 +59,5 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) } + void FileSysInfo::timerEvent(QTimerEvent*) { @@ -67,29 +68,20 @@ void FileSysInfo::updateMounts() { storage->update(); - + if ( rebuildDisks ) { - // Cannot auto delete QDict<MountInfo> disks because it seems to delete - // the filesystem object as well causing a segfault - MountInfo *mi; - for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit ) - { - mi = delit.current(); - mi->fs = 0x0; - delete mi; - } disks.clear(); lines.clear(); - + delete vb; vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); bool frst=TRUE; - + FileSystem *fs; for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) { fs = it.current(); - + if ( !frst ) { @@ -101,5 +93,5 @@ void FileSysInfo::updateMounts() } frst = FALSE; - + MountInfo *mi = new MountInfo( fs, container ); vb->addWidget( mi ); @@ -127,5 +119,5 @@ void FileSysInfo::updateMounts() i.current()->updateData(); } - + rebuildDisks = FALSE; } @@ -146,5 +138,5 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) fs = filesys; title = fs->name(); - + data = new GraphData(); graph = new BarGraph( this ); @@ -164,5 +156,4 @@ MountInfo::~MountInfo() { delete data; - delete fs; } |