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 ) | |||
51 | storage = new StorageInfo( this ); | 51 | storage = new StorageInfo( this ); |
52 | connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); | 52 | connect( storage, SIGNAL( disksChanged() ), this, SLOT( disksChanged() ) ); |
53 | 53 | ||
54 | lines.setAutoDelete(TRUE); | 54 | lines.setAutoDelete(TRUE); |
55 | 55 | ||
@@ -59,4 +59,5 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) | |||
59 | } | 59 | } |
60 | 60 | ||
61 | |||
61 | void FileSysInfo::timerEvent(QTimerEvent*) | 62 | void FileSysInfo::timerEvent(QTimerEvent*) |
62 | { | 63 | { |
@@ -67,29 +68,20 @@ void FileSysInfo::updateMounts() | |||
67 | { | 68 | { |
68 | storage->update(); | 69 | storage->update(); |
69 | 70 | ||
70 | if ( rebuildDisks ) | 71 | if ( rebuildDisks ) |
71 | { | 72 | { |
72 | // Cannot auto delete QDict<MountInfo> disks because it seems to delete | ||
73 | // the filesystem object as well causing a segfault | ||
74 | MountInfo *mi; | ||
75 | for ( QDictIterator<MountInfo> delit(disks); delit.current(); ++delit ) | ||
76 | { | ||
77 | mi = delit.current(); | ||
78 | mi->fs = 0x0; | ||
79 | delete mi; | ||
80 | } | ||
81 | disks.clear(); | 73 | disks.clear(); |
82 | lines.clear(); | 74 | lines.clear(); |
83 | 75 | ||
84 | delete vb; | 76 | delete vb; |
85 | vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); | 77 | vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); |
86 | 78 | ||
87 | bool frst=TRUE; | 79 | bool frst=TRUE; |
88 | 80 | ||
89 | FileSystem *fs; | 81 | FileSystem *fs; |
90 | for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) | 82 | for ( QListIterator<FileSystem> it(storage->fileSystems()); it.current(); ++it ) |
91 | { | 83 | { |
92 | fs = it.current(); | 84 | fs = it.current(); |
93 | 85 | ||
94 | if ( !frst ) | 86 | if ( !frst ) |
95 | { | 87 | { |
@@ -101,5 +93,5 @@ void FileSysInfo::updateMounts() | |||
101 | } | 93 | } |
102 | frst = FALSE; | 94 | frst = FALSE; |
103 | 95 | ||
104 | MountInfo *mi = new MountInfo( fs, container ); | 96 | MountInfo *mi = new MountInfo( fs, container ); |
105 | vb->addWidget( mi ); | 97 | vb->addWidget( mi ); |
@@ -127,5 +119,5 @@ void FileSysInfo::updateMounts() | |||
127 | i.current()->updateData(); | 119 | i.current()->updateData(); |
128 | } | 120 | } |
129 | 121 | ||
130 | rebuildDisks = FALSE; | 122 | rebuildDisks = FALSE; |
131 | } | 123 | } |
@@ -146,5 +138,5 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) | |||
146 | fs = filesys; | 138 | fs = filesys; |
147 | title = fs->name(); | 139 | title = fs->name(); |
148 | 140 | ||
149 | data = new GraphData(); | 141 | data = new GraphData(); |
150 | graph = new BarGraph( this ); | 142 | graph = new BarGraph( this ); |
@@ -164,5 +156,4 @@ MountInfo::~MountInfo() | |||
164 | { | 156 | { |
165 | delete data; | 157 | delete data; |
166 | delete fs; | ||
167 | } | 158 | } |
168 | 159 | ||