author | harlekin <harlekin> | 2002-10-31 23:13:41 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-10-31 23:13:41 (UTC) |
commit | aad44cbe72cda54a92e5f777fb3f4ea7d01cc429 (patch) (unidiff) | |
tree | cc922addb9fcc5a709870162923c70136cfb8e37 /library/storage.cpp | |
parent | 0fcca5c3bf885262393a9c3291e5c1823fe1b1b9 (diff) | |
download | opie-aad44cbe72cda54a92e5f777fb3f4ea7d01cc429.zip opie-aad44cbe72cda54a92e5f777fb3f4ea7d01cc429.tar.gz opie-aad44cbe72cda54a92e5f777fb3f4ea7d01cc429.tar.bz2 |
added ipaqs mmc slot to storage
-rw-r--r-- | library/storage.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/library/storage.cpp b/library/storage.cpp index 35e0255..937908d 100644 --- a/library/storage.cpp +++ b/library/storage.cpp | |||
@@ -81,13 +81,13 @@ const FileSystem *StorageInfo::fileSystemOf( const QString &filename ) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | void StorageInfo::cardMessage( const QCString& msg, const QByteArray& ) | 84 | void StorageInfo::cardMessage( const QCString& msg, const QByteArray& ) |
85 | { | 85 | { |
86 | if ( msg == "mtabChanged()" ) | 86 | if ( msg == "mtabChanged()" ) |
87 | update(); | 87 | update(); |
88 | } | 88 | } |
89 | // cause of the lack of a d pointer we need | 89 | // cause of the lack of a d pointer we need |
90 | // to store informations in a config file :( | 90 | // to store informations in a config file :( |
91 | void StorageInfo::update() | 91 | void StorageInfo::update() |
92 | { | 92 | { |
93 | //qDebug("StorageInfo::updating"); | 93 | //qDebug("StorageInfo::updating"); |
@@ -101,14 +101,15 @@ void StorageInfo::update() | |||
101 | bool rebuild = FALSE; | 101 | bool rebuild = FALSE; |
102 | int n=0; | 102 | int n=0; |
103 | if ( mntfp ) { | 103 | if ( mntfp ) { |
104 | while ( (me = getmntent( mntfp )) != 0 ) { | 104 | while ( (me = getmntent( mntfp )) != 0 ) { |
105 | QString fs = me->mnt_fsname; | 105 | QString fs = me->mnt_fsname; |
106 | if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd" | 106 | if ( fs.left(7)=="/dev/hd" || fs.left(7)=="/dev/sd" |
107 | || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd" | 107 | || fs.left(8)=="/dev/mtd" || fs.left(9) == "/dev/mmcd" |
108 | || fs.left(5)=="tmpfs" ) | 108 | || fs.left( 14 ) == "/dev/mmc/part1" |
109 | || fs.left(5)=="tmpfs" ) | ||
109 | { | 110 | { |
110 | n++; | 111 | n++; |
111 | curdisks.append(fs); | 112 | curdisks.append(fs); |
112 | curopts.append( me->mnt_opts ); | 113 | curopts.append( me->mnt_opts ); |
113 | //qDebug("-->fs %s opts %s", fs.latin1(), me->mnt_opts ); | 114 | //qDebug("-->fs %s opts %s", fs.latin1(), me->mnt_opts ); |
114 | curfs.append( me->mnt_dir ); | 115 | curfs.append( me->mnt_dir ); |
@@ -129,24 +130,27 @@ void StorageInfo::update() | |||
129 | mFileSystems.clear(); | 130 | mFileSystems.clear(); |
130 | QStringList::ConstIterator it=curdisks.begin(); | 131 | QStringList::ConstIterator it=curdisks.begin(); |
131 | QStringList::ConstIterator fsit=curfs.begin(); | 132 | QStringList::ConstIterator fsit=curfs.begin(); |
132 | QStringList::ConstIterator optsIt=curopts.begin(); | 133 | QStringList::ConstIterator optsIt=curopts.begin(); |
133 | for (; it!=curdisks.end(); ++it, ++fsit, ++optsIt) { | 134 | for (; it!=curdisks.end(); ++it, ++fsit, ++optsIt) { |
134 | QString opts = *optsIt; | 135 | QString opts = *optsIt; |
135 | 136 | ||
136 | QString disk = *it; | 137 | QString disk = *it; |
137 | QString humanname; | 138 | QString humanname; |
138 | bool removable = FALSE; | 139 | bool removable = FALSE; |
139 | if ( isCF(disk) ) { | 140 | if ( isCF(disk) ) { |
140 | humanname = tr("CF Card"); | 141 | humanname = tr("CF Card"); |
141 | removable = TRUE; | 142 | removable = TRUE; |
142 | } else if ( disk == "/dev/hda1" ) { | 143 | } else if ( disk == "/dev/hda1" ) { |
143 | humanname = tr("Hard Disk"); | 144 | humanname = tr("Hard Disk"); |
144 | } else if ( disk.left(9) == "/dev/mmcd" ) { | 145 | } else if ( disk.left(9) == "/dev/mmcd" ) { |
145 | humanname = tr("SD Card"); | 146 | humanname = tr("SD Card"); |
146 | removable = TRUE; | 147 | removable = TRUE; |
148 | } else if ( disk.left( 14 ) == "/dev/mmc/part1" ) { | ||
149 | humanname = tr("MMC Card"); | ||
150 | removable = TRUE; | ||
147 | } else if ( disk.left(7) == "/dev/hd" ) | 151 | } else if ( disk.left(7) == "/dev/hd" ) |
148 | humanname = tr("Hard Disk") + " " + disk; | 152 | humanname = tr("Hard Disk") + " " + disk; |
149 | else if ( disk.left(7) == "/dev/sd" ) | 153 | else if ( disk.left(7) == "/dev/sd" ) |
150 | humanname = tr("SCSI Hard Disk") + " " + disk; | 154 | humanname = tr("SCSI Hard Disk") + " " + disk; |
151 | else if ( disk.left(14) == "/dev/mtdblock6" ) //openzaurus ramfs | 155 | else if ( disk.left(14) == "/dev/mtdblock6" ) //openzaurus ramfs |
152 | humanname = tr("Internal Memory"); | 156 | humanname = tr("Internal Memory"); |