summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-10 13:19:28 (UTC)
committer llornkcor <llornkcor>2002-05-10 13:19:28 (UTC)
commit5d100217dc071b713e3531b9eedd2af6e0a2b4f1 (patch) (unidiff)
treefe0ef2fb657968e32a74db190f30486543f068be
parentd3ae8b4b27cf0eb8b412b7dafc88e48cb3b5fd3d (diff)
downloadopie-5d100217dc071b713e3531b9eedd2af6e0a2b4f1.zip
opie-5d100217dc071b713e3531b9eedd2af6e0a2b4f1.tar.gz
opie-5d100217dc071b713e3531b9eedd2af6e0a2b4f1.tar.bz2
make readout smaller
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/storage.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index 0a07a3b..f76fbdb 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -78,16 +78,17 @@ void StorageInfo::updateMounts()
78 QStringList curfs; 78 QStringList curfs;
79 QStringList mountList; 79 QStringList mountList;
80 QStringList fsT; 80 QStringList fsT;
81 bool rebuild = FALSE; 81 bool rebuild = FALSE;
82 int n=0; 82 int n=0;
83 if ( mntfp ) { 83 if ( mntfp ) {
84 while ( (me = getmntent( mntfp )) != 0 ) { 84 while ( (me = getmntent( mntfp )) != 0 ) {
85 QString fs = me->mnt_fsname; 85 QString fs = me->mnt_fsname;
86 qDebug(fs+" "+(QString)me->mnt_type);
86 if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd" 87 if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd"
87 || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd" 88 || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd"
88 || fs.left(9) == "/dev/root" || fs.left(5) == "/ramfs") { 89 || fs.left(9) == "/dev/root" || fs.left(5) == "/ramfs") {
89 n++; 90 n++;
90 curdisks.append(fs); 91 curdisks.append(fs);
91 QString d = me->mnt_dir; 92 QString d = me->mnt_dir;
92 curfs.append(d); 93 curfs.append(d);
93 QString mount = me->mnt_dir; 94 QString mount = me->mnt_dir;
@@ -115,34 +116,35 @@ void StorageInfo::updateMounts()
115 if ( !frst ) { 116 if ( !frst ) {
116 QFrame *f = new QFrame( this ); 117 QFrame *f = new QFrame( this );
117 vb->addWidget(f); 118 vb->addWidget(f);
118 f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); 119 f->setFrameStyle( QFrame::HLine | QFrame::Sunken );
119 lines.append(f); 120 lines.append(f);
120 f->show(); 121 f->show();
121 } frst=FALSE; 122 } frst=FALSE;
122 QString humanname=*it; 123 QString humanname=*it;
124// qDebug(humanname);
123 if ( isCF(humanname) ) 125 if ( isCF(humanname) )
124 humanname = tr("CF Card: "+*fsmount+" "+*fsTit+" "); 126 humanname = tr("CF Card: "+*fsmount+" "+*fsTit+" ");
125 else if ( humanname == "/dev/hda1" ) 127 else if ( humanname == "/dev/hda1" )
126 humanname = tr("Hard Disk "+*fsmount+" "+*fsTit+" "); 128 humanname = tr("Hard Disk "+*fsmount+" "+*fsTit+" ");
127 else if ( humanname.left(9) == "/dev/mmcd" ) 129 else if ( humanname.left(9) == "/dev/mmcd" )
128 humanname = tr("SD Card "+*fsmount+" "+*fsTit+" "); 130 humanname = tr("SD Card "+*fsmount+" "+*fsTit+" ");
129 else if ( humanname.left(7) == "/dev/hd" ) 131 else if ( humanname.left(7) == "/dev/hd" )
130 humanname = tr("Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" "; 132 humanname = tr("Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
131 else if ( humanname.left(7) == "/dev/sd" ) 133 else if ( humanname.left(7) == "/dev/sd" )
132 humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" "; 134 humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7)+" "+*fsmount+" "+*fsTit+" ";
133 else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) 135 else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" )
134 humanname = tr("Internal Storage "+*fsmount+" "+*fsTit+"\n"); 136 humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+"\n");
135 else if ( humanname.left(14) == "/dev/mtdblock/" ) 137 else if ( humanname.left(14) == "/dev/mtdblock/" )
136 humanname = tr("Internal Storage") + " " + humanname.mid(14)+" "+*fsmount+" "+*fsTit+" "; 138 humanname = tr("Int. Storage") + " " + humanname.mid(14)+" "+*fsmount+" "+*fsTit+" ";
137 else if ( humanname.left(13) == "/dev/mtdblock" ) 139 else if ( humanname.left(13) == "/dev/mtdblock" )
138 humanname = tr("Internal Storage") + " " + humanname.mid(13)+" "+*fsmount+" "+*fsTit+" "; 140 humanname = tr("Int. Storage") + " " + humanname.mid(13)+" "+*fsmount+" "+*fsTit+" ";
139 else if ( humanname.left(9) == "/dev/root" ) 141 else if ( humanname.left(9) == "/dev/root" )
140 humanname = tr("Internal Storage "+*fsmount+" "+*fsTit+" "); 142 humanname = tr("Int. Storage "+*fsmount+" "+*fsTit+" ");
141 // etc. 143 // etc.
142 MountInfo* mi = new MountInfo( *fsit, humanname, this ); 144 MountInfo* mi = new MountInfo( *fsit, humanname, this );
143 vb->addWidget(mi); 145 vb->addWidget(mi);
144 disks.insert(*fsit,mi); 146 disks.insert(*fsit,mi);
145 mi->show(); 147 mi->show();
146 fsmount++;fsTit++; 148 fsmount++;fsTit++;
147 } 149 }
148 vb->addStretch(); 150 vb->addStretch();
@@ -191,17 +193,17 @@ void MountInfo::updateData()
191 193
192 long mult = fs->blockSize() / 1024; 194 long mult = fs->blockSize() / 1024;
193 long div = 1024 / fs->blockSize(); 195 long div = 1024 / fs->blockSize();
194 if ( !mult ) mult = 1; 196 if ( !mult ) mult = 1;
195 if ( !div ) div = 1; 197 if ( !div ) div = 1;
196 long total = fs->totalBlocks() * mult / div; 198 long total = fs->totalBlocks() * mult / div;
197 long avail = fs->availBlocks() * mult / div; 199 long avail = fs->availBlocks() * mult / div;
198 long used = total - avail; 200 long used = total - avail;
199 totalSize->setText( title + tr("Total: %1 kB").arg( total ) ); 201 totalSize->setText( title + tr(" : %1 kB").arg( total ) );
200 data->clear(); 202 data->clear();
201 data->addItem( tr("Used (%1 kB)").arg(used), used ); 203 data->addItem( tr("Used (%1 kB)").arg(used), used );
202 data->addItem( tr("Available (%1 kB)").arg(avail), avail ); 204 data->addItem( tr("Available (%1 kB)").arg(avail), avail );
203 graph->repaint( FALSE ); 205 graph->repaint( FALSE );
204 legend->update(); 206 legend->update();
205 graph->show(); 207 graph->show();
206 legend->show(); 208 legend->show();
207} 209}