Diffstat (limited to 'noncore/settings/sysinfo/storage.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 11 |
1 files changed, 1 insertions, 10 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 | |||
@@ -53,36 +53,28 @@ FileSysInfo::FileSysInfo( QWidget *parent, const char *name ) | |||
53 | 53 | ||
54 | lines.setAutoDelete(TRUE); | 54 | lines.setAutoDelete(TRUE); |
55 | 55 | ||
56 | rebuildDisks = TRUE; | 56 | rebuildDisks = TRUE; |
57 | updateMounts(); | 57 | updateMounts(); |
58 | startTimer( 5000 ); | 58 | startTimer( 5000 ); |
59 | } | 59 | } |
60 | 60 | ||
61 | |||
61 | void FileSysInfo::timerEvent(QTimerEvent*) | 62 | void FileSysInfo::timerEvent(QTimerEvent*) |
62 | { | 63 | { |
63 | updateMounts(); | 64 | updateMounts(); |
64 | } | 65 | } |
65 | 66 | ||
66 | void FileSysInfo::updateMounts() | 67 | 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 | ||
@@ -158,17 +150,16 @@ MountInfo::MountInfo( FileSystem *filesys, QWidget *parent, const char *name ) | |||
158 | legend->setData( data ); | 150 | legend->setData( data ); |
159 | 151 | ||
160 | updateData(); | 152 | updateData(); |
161 | } | 153 | } |
162 | 154 | ||
163 | MountInfo::~MountInfo() | 155 | MountInfo::~MountInfo() |
164 | { | 156 | { |
165 | delete data; | 157 | delete data; |
166 | delete fs; | ||
167 | } | 158 | } |
168 | 159 | ||
169 | void MountInfo::updateData() | 160 | void MountInfo::updateData() |
170 | { | 161 | { |
171 | long mult = fs->blockSize() / 1024; | 162 | long mult = fs->blockSize() / 1024; |
172 | long div = 1024 / fs->blockSize(); | 163 | long div = 1024 / fs->blockSize(); |
173 | if ( !mult ) mult = 1; | 164 | if ( !mult ) mult = 1; |
174 | if ( !div ) div = 1; | 165 | if ( !div ) div = 1; |