summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-12-17 01:43:27 (UTC)
committer llornkcor <llornkcor>2002-12-17 01:43:27 (UTC)
commit2c338cc2ed1815c243cc88ed4506d1de184c19e0 (patch) (unidiff)
tree28f58530a213256bd05fca4edeacc9a7e8810db9
parentcf373af175eb2d017acc6114e492452f1b4d2560 (diff)
downloadopie-2c338cc2ed1815c243cc88ed4506d1de184c19e0.zip
opie-2c338cc2ed1815c243cc88ed4506d1de184c19e0.tar.gz
opie-2c338cc2ed1815c243cc88ed4506d1de184c19e0.tar.bz2
fix mtdblock string display
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/storage.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/noncore/settings/sysinfo/storage.cpp b/noncore/settings/sysinfo/storage.cpp
index 5d6cd1b..eb157ef 100644
--- a/noncore/settings/sysinfo/storage.cpp
+++ b/noncore/settings/sysinfo/storage.cpp
@@ -35,18 +35,18 @@
35 35
36StorageInfo::StorageInfo( QWidget *parent, const char *name ) 36StorageInfo::StorageInfo( QWidget *parent, const char *name )
37 : QWidget( parent, name ) 37 : QWidget( parent, name )
38{ 38{
39 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 39 QVBoxLayout *tmpvb = new QVBoxLayout( this );
40 QScrollView *sv = new QScrollView( this ); 40 QScrollView *sv = new QScrollView( this );
41 tmpvb->addWidget( sv, 0, 0 ); 41 tmpvb->addWidget( sv, 0, 0 );
42 sv->setResizePolicy( QScrollView::AutoOneFit ); 42 sv->setResizePolicy( QScrollView::AutoOneFit );
43 sv->setFrameStyle( QFrame::NoFrame ); 43 sv->setFrameStyle( QFrame::NoFrame );
44 container = new QWidget( sv->viewport() ); 44 container = new QWidget( sv->viewport() );
45 sv->addChild( container ); 45 sv->addChild( container );
46 vb = 0x0; 46 vb = 0x0;
47 47
48 disks.setAutoDelete(TRUE); 48 disks.setAutoDelete(TRUE);
49 lines.setAutoDelete(TRUE); 49 lines.setAutoDelete(TRUE);
50 updateMounts(); 50 updateMounts();
51 startTimer( 5000 ); 51 startTimer( 5000 );
52} 52}
@@ -94,9 +94,10 @@ void StorageInfo::updateMounts()
94 while ( (me = getmntent( mntfp )) != 0 ) { 94 while ( (me = getmntent( mntfp )) != 0 ) {
95 QString fs = me->mnt_fsname; 95 QString fs = me->mnt_fsname;
96 if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd" 96 if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd"
97 || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd" 97 || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd"
98 || fs.left(9) == "/dev/root" || fs.left(5) == "/ramfs" || fs.left(5) == "tmpfs" ) { 98 || fs.left(9) == "/dev/root" || fs.left(5) == "/ramfs"
99 || fs.left(5) == "tmpfs" ) {
99 n++; 100 n++;
100 curdisks.append(fs); 101 curdisks.append(fs);
101 QString d = me->mnt_dir; 102 QString d = me->mnt_dir;
102 curfs.append(d); 103 curfs.append(d);
@@ -115,12 +116,12 @@ void StorageInfo::updateMounts()
115 lines.clear(); 116 lines.clear();
116 delete vb; 117 delete vb;
117 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ ); 118 vb = new QVBoxLayout( container/*, n > 3 ? 1 : 5*/ );
118 bool frst=TRUE; 119 bool frst=TRUE;
119 QStringList::ConstIterator it=curdisks.begin(); 120 QStringList::ConstIterator it = curdisks.begin();
120 QStringList::ConstIterator fsit=curfs.begin(); 121 QStringList::ConstIterator fsit = curfs.begin();
121 QStringList::ConstIterator fsmount=mountList.begin(); 122 QStringList::ConstIterator fsmount = mountList.begin();
122 QStringList::ConstIterator fsTit=fsT.begin(); 123 QStringList::ConstIterator fsTit = fsT.begin();
123 124
124 for (; it!=curdisks.end(); ++it, ++fsit) { 125 for (; it!=curdisks.end(); ++it, ++fsit) {
125 if ( !frst ) { 126 if ( !frst ) {
126 QFrame *f = new QFrame( container ); 127 QFrame *f = new QFrame( container );
@@ -133,22 +134,23 @@ void StorageInfo::updateMounts()
133 if ( isCF(humanname) ) 134 if ( isCF(humanname) )
134 humanname = tr( "CF Card: " ); 135 humanname = tr( "CF Card: " );
135 else if ( humanname == "/dev/hda1" ) 136 else if ( humanname == "/dev/hda1" )
136 humanname = tr( "Hard Disk " ); 137 humanname = tr( "Hard Disk " );
138
137 else if ( humanname.left(9) == "/dev/mmcd" ) 139 else if ( humanname.left(9) == "/dev/mmcd" )
138 humanname = tr( "SD Card " ); 140 humanname = tr( "SD Card " );
141
139 else if ( humanname.left(7) == "/dev/hd" ) 142 else if ( humanname.left(7) == "/dev/hd" )
140 humanname = tr( "Hard Disk /dev/hd " ); 143 humanname = tr( "Hard Disk /dev/hd " );
144
141 else if ( humanname.left(7) == "/dev/sd" ) 145 else if ( humanname.left(7) == "/dev/sd" )
142 humanname = tr( "SCSI Hard Disk /dev/sd " ); 146 humanname = tr( "SCSI Hard Disk /dev/sd " );
143 else if ( humanname == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) 147
144 humanname = tr( "Int. Storage " ); 148 else if ( humanname == "/dev/mtdblock1"
145 else if ( humanname.left(14) == "/dev/mtdblock/" ) 149 || humanname.left(13) == "/dev/mtdblock"
146 humanname = tr( "Int. Storage /dev/mtdblock/ " ); 150 || humanname.left(9) == "/dev/root")
147 else if ( humanname.left(13) == "/dev/mtdblock" ) 151 humanname = tr( "Int. Storage " );
148 humanname = tr( "Int. Storage /dev/mtdblock " ); 152
149 else if ( humanname.left(9) == "/dev/root" )
150 humanname = tr( "Int. Storage " );
151 else if ( humanname.left(5) == "tmpfs" ) 153 else if ( humanname.left(5) == "tmpfs" )
152 humanname = tr( "RAM disk" ); 154 humanname = tr( "RAM disk" );
153 // etc. 155 // etc.
154 humanname.append( *fsmount ); 156 humanname.append( *fsmount );