Changeset 509
- Timestamp:
- 2007-07-11 01:45:02 (1 year ago)
- Files:
-
- trunk/chrome/content/common/internalFunctions.js (modified) (1 diff)
- trunk/chrome/content/dta/manager.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/chrome/content/common/internalFunctions.js
r488 r509 260 260 }, 261 261 /** 262 * Gets the disk-space available for a nsILocalFile. 263 * Here, because diskSpaceAvailable requires valid path and/or path to be a directory 264 * @param file Valid nsILocalFile 265 * @return the diskspace available to the caller 266 * @author Nils 267 */ 268 getFreeDisk: function(file) { 269 while (file) { 270 if (file.exists() && file.isDirectory()) { 271 return file.diskSpaceAvailable; 272 } 273 file = file.parent; 274 } 275 return 0; 276 }, 277 /** 262 278 * Play a sound file (if prefs allow to do so) 263 279 * @param name Name of the sound (correpsonding to the pref name and the file name of desired sound) trunk/chrome/content/dta/manager.js
r500 r509 1963 1963 if (tmp) { 1964 1964 vtmp = Utils.validateDir(tmp); 1965 if (!vtmp && vtmp.diskSpaceAvailable< tsd) {1965 if (!vtmp && Utils.getFreeDisk(vtmp) < tsd) { 1966 1966 d.fail(_("ndsa"), _("spacetemp"), _("freespace")); 1967 1967 return; … … 1972 1972 throw new Error("invalid destination folder"); 1973 1973 } 1974 var nsd = realDest.diskSpaceAvailable;1974 var nsd = Utils.getFreeDisk(realDest); 1975 1975 // Same save path or same disk (we assume that tmp.avail == dst.avail means same disk) 1976 1976 // simply moving should succeed 1977 if (d.compression && (!tmp || vtmp.diskSpaceAvailable== nsd)) {1977 if (d.compression && (!tmp || Utils.getFreeDisk(vtmp) == nsd)) { 1978 1978 // we cannot know how much space we will consume after decompressing. 1979 1979 // so we assume factor 1.0 for the compressed and factor 1.5 for the decompressed file. … … 1981 1981 } 1982 1982 if (nsd < tsd) { 1983 Debug.dump("nsd", nsd); 1984 Debug.dump("tsd", tsd); 1983 1985 d.fail(_("ndsa"), _("spacedir"), _("freespace")); 1984 1986 return;
