summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/storage.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index f76fbdb..b369ff1 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -198,43 +198,37 @@ void MountInfo::updateData()
198 long total = fs->totalBlocks() * mult / div; 198 long total = fs->totalBlocks() * mult / div;
199 long avail = fs->availBlocks() * mult / div; 199 long avail = fs->availBlocks() * mult / div;
200 long used = total - avail; 200 long used = total - avail;
201 totalSize->setText( title + tr(" : %1 kB").arg( total ) ); 201 totalSize->setText( title + tr(" : %1 kB").arg( total ) );
202 data->clear(); 202 data->clear();
203 data->addItem( tr("Used (%1 kB)").arg(used), used ); 203 data->addItem( tr("Used (%1 kB)").arg(used), used );
204 data->addItem( tr("Available (%1 kB)").arg(avail), avail ); 204 data->addItem( tr("Available (%1 kB)").arg(avail), avail );
205 graph->repaint( FALSE ); 205 graph->repaint( FALSE );
206 legend->update(); 206 legend->update();
207 graph->show(); 207 graph->show();
208 legend->show(); 208 legend->show();
209} 209}
210 210
211//--------------------------------------------------------------------------- 211//---------------------------------------------------------------------------
212 212
213FileSystem::FileSystem( const QString &p ) 213FileSystem::FileSystem( const QString &p )
214 : fspath( p ), blkSize(512), totalBlks(0), availBlks(0) 214 : fspath( p ), blkSize(512), totalBlks(0), availBlks(0)
215{ 215{
216 update(); 216 update();
217} 217}
218 218
219void FileSystem::update() 219void FileSystem::update()
220{ 220{
221#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 221#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
222 struct statfs fs; 222 struct statfs fs;
223 if ( !statfs( fspath.latin1(), &fs ) ) { 223 if ( !statfs( fspath.latin1(), &fs ) ) {
224 if( fspath.left(8) == "/mnt/ram") { //ugly hack openzaurus 224 blkSize = fs.f_bsize;
225 blkSize = fs.f_bsize; 225 totalBlks = fs.f_blocks;
226 totalBlks = fs.f_blocks; 226 availBlks = fs.f_bavail;
227 availBlks = fs.f_ffree; 227 } else {
228 } else { 228 blkSize = 0;
229 blkSize = fs.f_bsize; 229 totalBlks = 0;
230 totalBlks = fs.f_blocks; 230 availBlks = 0;
231 availBlks = fs.f_bavail; 231 }
232 }
233 } else {
234 blkSize = 0;
235 totalBlks = 0;
236 availBlks = 0;
237 }
238#endif 232#endif
239} 233}
240 234