-rw-r--r-- | noncore/settings/sysinfo/storage.cpp | 26 |
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() long total = fs->totalBlocks() * mult / div; long avail = fs->availBlocks() * mult / div; long used = total - avail; totalSize->setText( title + tr(" : %1 kB").arg( total ) ); data->clear(); data->addItem( tr("Used (%1 kB)").arg(used), used ); data->addItem( tr("Available (%1 kB)").arg(avail), avail ); graph->repaint( FALSE ); legend->update(); graph->show(); legend->show(); } //--------------------------------------------------------------------------- FileSystem::FileSystem( const QString &p ) : fspath( p ), blkSize(512), totalBlks(0), availBlks(0) { update(); } void FileSystem::update() { #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) - struct statfs fs; - if ( !statfs( fspath.latin1(), &fs ) ) { - if( fspath.left(8) == "/mnt/ram") { //ugly hack openzaurus - blkSize = fs.f_bsize; - totalBlks = fs.f_blocks; - availBlks = fs.f_ffree; - } else { - blkSize = fs.f_bsize; - totalBlks = fs.f_blocks; - availBlks = fs.f_bavail; - } - } else { - blkSize = 0; - totalBlks = 0; - availBlks = 0; - } + struct statfs fs; + if ( !statfs( fspath.latin1(), &fs ) ) { + blkSize = fs.f_bsize; + totalBlks = fs.f_blocks; + availBlks = fs.f_bavail; + } else { + blkSize = 0; + totalBlks = 0; + availBlks = 0; + } #endif } |