author | leseb <leseb> | 2002-08-30 18:10:11 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-08-30 18:10:11 (UTC) |
commit | b5ec106e5f612042987397a5a5b6683fdabaf793 (patch) (unidiff) | |
tree | 58da0aac60a7a39cca162fe222107c9e3d676dac /library | |
parent | f6125710c0ca99fc62ffce69973a168b6604f29d (diff) | |
download | opie-b5ec106e5f612042987397a5a5b6683fdabaf793.zip opie-b5ec106e5f612042987397a5a5b6683fdabaf793.tar.gz opie-b5ec106e5f612042987397a5a5b6683fdabaf793.tar.bz2 |
Try to handle RAM storage for documents
-rw-r--r-- | library/applnk.cpp | 2 | ||||
-rw-r--r-- | library/global.cpp | 4 | ||||
-rw-r--r-- | library/lnkproperties.cpp | 7 | ||||
-rw-r--r-- | library/storage.cpp | 14 |
4 files changed, 16 insertions, 11 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 5185b5f..778ccab 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -340,7 +340,7 @@ QString AppLnk::linkFile() const | |||
340 | if ( type().contains('/') ) { | 340 | if ( type().contains('/') ) { |
341 | StorageInfo storage; | 341 | StorageInfo storage; |
342 | const FileSystem *fs = storage.fileSystemOf( that->mFile ); | 342 | const FileSystem *fs = storage.fileSystemOf( that->mFile ); |
343 | if ( fs && fs->isRemovable() ) { | 343 | if ( fs && ( fs->isRemovable() || fs->disk() == "/dev/mtdblock6" || fs->disk() == "tmpfs" ) ) { |
344 | that->mLinkFile = fs->path(); | 344 | that->mLinkFile = fs->path(); |
345 | } else | 345 | } else |
346 | that->mLinkFile = getenv( "HOME" ); | 346 | that->mLinkFile = getenv( "HOME" ); |
diff --git a/library/global.cpp b/library/global.cpp index edb7b85..ab27b3f 100644 --- a/library/global.cpp +++ b/library/global.cpp | |||
@@ -681,6 +681,10 @@ void Global::findDocuments(DocLnkSet* folder, const QString &mimefilter) | |||
681 | continue; | 681 | continue; |
682 | DocLnkSet ide( path, mimefilter ); | 682 | DocLnkSet ide( path, mimefilter ); |
683 | folder->appendFrom(ide); | 683 | folder->appendFrom(ide); |
684 | } else if ( (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) { | ||
685 | QString path = (*it)->path() + "/Documents"; | ||
686 | DocLnkSet ide( path, mimefilter ); | ||
687 | folder->appendFrom(ide); | ||
684 | } | 688 | } |
685 | } | 689 | } |
686 | } | 690 | } |
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp index e8baca6..c020328 100644 --- a/library/lnkproperties.cpp +++ b/library/lnkproperties.cpp | |||
@@ -173,15 +173,16 @@ void LnkProperties::setupLocations() | |||
173 | if ( (*it)->availBlocks() * (*it)->blockSize() > fileSize + 10000 ) { | 173 | if ( (*it)->availBlocks() * (*it)->blockSize() > fileSize + 10000 ) { |
174 | if ( (*it)->isRemovable() || | 174 | if ( (*it)->isRemovable() || |
175 | (*it)->disk() == "/dev/mtdblock1" || | 175 | (*it)->disk() == "/dev/mtdblock1" || |
176 | (*it)->disk() == "/dev/mtdblock/1" || (*it)->disk().left(13) == "/dev/mtdblock" ) { | 176 | (*it)->disk() == "/dev/mtdblock/1" || (*it)->disk().left(13) == "/dev/mtdblock" || |
177 | (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) { | ||
177 | d->locationCombo->insertItem( (*it)->name(), index ); | 178 | d->locationCombo->insertItem( (*it)->name(), index ); |
178 | locations.append( ((*it)->isRemovable() ? (*it)->path() : homeDir) ); | 179 | locations.append( ((*it)->isRemovable() || (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ? (*it)->path() : homeDir) ); |
179 | if ( lnk->file().contains( (*it)->path() ) ) { | 180 | if ( lnk->file().contains( (*it)->path() ) ) { |
180 | d->locationCombo->setCurrentItem( index ); | 181 | d->locationCombo->setCurrentItem( index ); |
181 | currentLocation = index; | 182 | currentLocation = index; |
182 | } | 183 | } |
183 | index++; | 184 | index++; |
184 | } else if ( (*it)->name().contains( "Hard Disk") && | 185 | } else if ( (*it)->name().contains( tr("Hard Disk") ) && |
185 | homeDir.contains( (*it)->path() ) && | 186 | homeDir.contains( (*it)->path() ) && |
186 | (*it)->path().length() > hardDiskHome.length() ) { | 187 | (*it)->path().length() > hardDiskHome.length() ) { |
187 | hardDiskHome = (*it)->name(); | 188 | hardDiskHome = (*it)->name(); |
diff --git a/library/storage.cpp b/library/storage.cpp index 2d996fa..13639fe 100644 --- a/library/storage.cpp +++ b/library/storage.cpp | |||
@@ -105,7 +105,7 @@ void StorageInfo::update() | |||
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(8)=="/dev/ram" || fs.left(5)=="tmpfs" ) | 108 | || fs.left(5)=="tmpfs" ) |
109 | { | 109 | { |
110 | n++; | 110 | n++; |
111 | curdisks.append(fs); | 111 | curdisks.append(fs); |
@@ -145,19 +145,19 @@ void StorageInfo::update() | |||
145 | humanname = tr("SD Card"); | 145 | humanname = tr("SD Card"); |
146 | removable = TRUE; | 146 | removable = TRUE; |
147 | } else if ( disk.left(7) == "/dev/hd" ) | 147 | } else if ( disk.left(7) == "/dev/hd" ) |
148 | humanname = tr("Hard Disk") + " " + humanname.mid(7); | 148 | humanname = tr("Hard Disk") + " " + disk.mid(7); |
149 | else if ( disk.left(7) == "/dev/sd" ) | 149 | else if ( disk.left(7) == "/dev/sd" ) |
150 | humanname = tr("SCSI Hard Disk") + " " + humanname.mid(7); | 150 | humanname = tr("SCSI Hard Disk") + " " + disk.mid(7); |
151 | else if ( disk.left(14) == "/dev/mtdblock6" ) //openzaurus ramfs | 151 | else if ( disk.left(14) == "/dev/mtdblock6" ) //openzaurus ramfs |
152 | humanname = tr("Ram FS") + " " + humanname.mid(14); | 152 | humanname = tr("Internal Memory"); |
153 | else if ( disk == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) | 153 | else if ( disk == "/dev/mtdblock1" || humanname == "/dev/mtdblock/1" ) |
154 | humanname = tr("Internal Storage"); | 154 | humanname = tr("Internal Storage"); |
155 | else if ( disk.left(14) == "/dev/mtdblock/" ) | 155 | else if ( disk.left(14) == "/dev/mtdblock/" ) |
156 | humanname = tr("Internal Storage") + " " + humanname.mid(14); | 156 | humanname = tr("Internal Storage") + " " + disk.mid(14); |
157 | else if ( disk.left(13) == "/dev/mtdblock" ) | 157 | else if ( disk.left(13) == "/dev/mtdblock" ) |
158 | humanname = tr("Internal Storage") + " " + humanname.mid(13); | 158 | humanname = tr("Internal Storage") + " " + disk.mid(13); |
159 | else if ( disk.left(5) == "tmpfs" ) //ipaqs /mnt/ramfs | 159 | else if ( disk.left(5) == "tmpfs" ) //ipaqs /mnt/ramfs |
160 | humanname = tr("Ram FS") + " " + humanname.mid(5); | 160 | humanname = tr("Internal Memory"); |
161 | FileSystem *fs = new FileSystem( disk, *fsit, humanname, removable, opts ); | 161 | FileSystem *fs = new FileSystem( disk, *fsit, humanname, removable, opts ); |
162 | mFileSystems.append( fs ); | 162 | mFileSystems.append( fs ); |
163 | } | 163 | } |