summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sysinfo/storage.cpp46
1 files changed, 32 insertions, 14 deletions
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index 4e81170..0a07a3b 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -19,3 +19,3 @@
**********************************************************************/
-
+// additions copyright 2002 by L.J. Potter
#include <qlabel.h>
@@ -59,4 +59,3 @@ static bool isCF(const QString& m)
// 0 ide ide-cs 0 hda 3 0
- if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 )
- {
+ if ( sscanf(line,"%*d %s %*s %*s %s", devtype, devname )==2 ) {
if ( QString(devtype) == "ide" && m.find(devname)>0 ) {
@@ -79,2 +78,4 @@ void StorageInfo::updateMounts()
QStringList curfs;
+ QStringList mountList;
+ QStringList fsT;
bool rebuild = FALSE;
@@ -85,4 +86,4 @@ void StorageInfo::updateMounts()
if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd"
- || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd" )
- {
+ || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd"
+ || fs.left(9) == "/dev/root" || fs.left(5) == "/ramfs") {
n++;
@@ -91,2 +92,6 @@ void StorageInfo::updateMounts()
curfs.append(d);
+ QString mount = me->mnt_dir;
+ mountList.append(mount);
+ QString t = me->mnt_type;
+ fsT.append(t);
if ( !disks.find(d) )
@@ -105,2 +110,5 @@ void StorageInfo::updateMounts()
QStringList::ConstIterator fsit=curfs.begin();
+ QStringList::ConstIterator fsmount=mountList.begin();
+ QStringList::ConstIterator fsTit=fsT.begin();
+
for (; it!=curdisks.end(); ++it, ++fsit) {
@@ -115,17 +123,19 @@ void StorageInfo::updateMounts()
if ( isCF(humanname) )
- humanname = tr("CF Card");
+ humanname = tr("CF Card: "+*fsmount+" "+*fsTit+" ");
else if ( humanname == "/dev/hda1" )
- humanname = tr("Hard Disk");
+ humanname = tr("Hard Disk "+*fsmount+" "+*fsTit+" ");
else if ( humanname.left(9) == "/dev/mmcd" )
- humanname = tr("SD Card");
+ humanname = tr("SD Card "+*fsmount+" "+*fsTit+" ");
else if ( humanname.left(7) == "/dev/hd" )
- humanname = tr("Hard Disk") + " " + humanname.mid(7);
+ humanname = tr("Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
else if ( humanname.left(7) == "/dev/sd" )
- humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7);
+ humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" )
- humanname = tr("Internal Storage");
+ humanname = tr("Internal Storage "+*fsmount+" "+*fsTit+"\n");
else if ( humanname.left(14) == "/dev/mtdblock/" )
- humanname = tr("Internal Storage") + " " + humanname.mid(14);
+ humanname = tr("Internal Storage") + " " + humanname.mid(14)+" "+*fsmount+" "+*fsTit+" ";
else if ( humanname.left(13) == "/dev/mtdblock" )
- humanname = tr("Internal Storage") + " " + humanname.mid(13);
+ humanname = tr("Internal Storage") + " " + humanname.mid(13)+" "+*fsmount+" "+*fsTit+" ";
+ else if ( humanname.left(9) == "/dev/root" )
+ humanname = tr("Internal Storage "+*fsmount+" "+*fsTit+" ");
// etc.
@@ -135,2 +145,3 @@ void StorageInfo::updateMounts()
mi->show();
+ fsmount++;fsTit++;
}
@@ -149,2 +160,3 @@ MountInfo::MountInfo( const QString &path, const QString &ttl, QWidget *parent,
{
+ qDebug("new path is "+path);
fs = new FileSystem( path );
@@ -186,3 +198,3 @@ void MountInfo::updateData()
long used = total - avail;
- totalSize->setText( title + tr(" total: %1 kB").arg( total ) );
+ totalSize->setText( title + tr("Total: %1 kB").arg( total ) );
data->clear();
@@ -209,2 +221,7 @@ void FileSystem::update()
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;
@@ -212,2 +229,3 @@ void FileSystem::update()
availBlks = fs.f_bavail;
+ }
} else {