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/lnkproperties.cpp | |
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/lnkproperties.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp index e8baca6..c020328 100644 --- a/library/lnkproperties.cpp +++ b/library/lnkproperties.cpp | |||
@@ -160,41 +160,42 @@ void LnkProperties::setupLocations() | |||
160 | QFileInfo fi( lnk->file() ); | 160 | QFileInfo fi( lnk->file() ); |
161 | fileSize = fi.size(); | 161 | fileSize = fi.size(); |
162 | StorageInfo storage; | 162 | StorageInfo storage; |
163 | const QList<FileSystem> &fs = storage.fileSystems(); | 163 | const QList<FileSystem> &fs = storage.fileSystems(); |
164 | QListIterator<FileSystem> it ( fs ); | 164 | QListIterator<FileSystem> it ( fs ); |
165 | QString s; | 165 | QString s; |
166 | QString homeDir = getenv("HOME"); | 166 | QString homeDir = getenv("HOME"); |
167 | QString hardDiskHome; | 167 | QString hardDiskHome; |
168 | QString hardDiskPath; | 168 | QString hardDiskPath; |
169 | int index = 0; | 169 | int index = 0; |
170 | currentLocation = -1; | 170 | currentLocation = -1; |
171 | for ( ; it.current(); ++it ) { | 171 | for ( ; it.current(); ++it ) { |
172 | // we add 10k to the file size so we are sure we can also save the desktop file | 172 | // we add 10k to the file size so we are sure we can also save the desktop file |
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(); |
188 | hardDiskPath = (*it)->path(); | 189 | hardDiskPath = (*it)->path(); |
189 | } | 190 | } |
190 | } | 191 | } |
191 | } | 192 | } |
192 | if ( !hardDiskHome.isEmpty() ) { | 193 | if ( !hardDiskHome.isEmpty() ) { |
193 | d->locationCombo->insertItem( hardDiskHome ); | 194 | d->locationCombo->insertItem( hardDiskHome ); |
194 | locations.append( hardDiskPath ); | 195 | locations.append( hardDiskPath ); |
195 | if ( currentLocation == -1 ) { // assume it's the hard disk | 196 | if ( currentLocation == -1 ) { // assume it's the hard disk |
196 | d->locationCombo->setCurrentItem( index ); | 197 | d->locationCombo->setCurrentItem( index ); |
197 | currentLocation = index; | 198 | currentLocation = index; |
198 | } | 199 | } |
199 | } | 200 | } |
200 | } | 201 | } |