Skip to content

Commit

Permalink
1.3-night.rev3
Browse files Browse the repository at this point in the history
* Discovered that Macs do have a "Pictures" folder and I can get that
with special keyword "Pct" so I hooked that up.
* Also found a bug where block link7984654 was not using the pref value
- in the click to cancel reupload and quick save
  • Loading branch information
Noitidart committed Jan 8, 2016
1 parent 1bf4c0d commit f61b7b3
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1512,18 +1512,7 @@ var gEditor = {

// start - copy block link7984654 - slight modificaiton
// get save path
var OSPath_saveDir;
try {
OSPath_saveDir = Services.dirsvc.get('XDGPict', Ci.nsIFile).path;
} catch (ex) {

try {
OSPath_saveDir = Services.dirsvc.get('Pict', Ci.nsIFile).path;
} catch (ex) {

OSPath_saveDir = OS.Constants.Path.desktopDir;
}
}
var OSPath_saveDir = getPrefNoSetStuff('quick_save_dir');

// generate file name
var filename = myServices.sb.GetStringFromName('screenshot') + ' - ' + getSafedForOSPath(new Date().toLocaleFormat()) + ' - ' + myServices.sb.GetStringFromName('failed-upload') + '.png';
Expand Down Expand Up @@ -3065,14 +3054,16 @@ function getPrefNoSetStuff(aPrefName) {
// os path to dir to save in
var defaultVal = function() {
try {
return Services.dirsvc.get('XDGPict', Ci.nsIFile).path;
} catch (ex if ex.result == Cr.NS_ERROR_FAILURE) { // this cr when path at keyword doesnt exist

OSPath_saveDir = Services.dirsvc.get('XDGPict', Ci.nsIFile).path; // works on linux
} catch (ex) {
try {
return Services.dirsvc.get('Pict', Ci.nsIFile).path;
} catch (ex if ex.result == Cr.NS_ERROR_FAILURE) { // this cr when path at keyword doesnt exist

return OS.Constants.Path.desktopDir;
OSPath_saveDir = Services.dirsvc.get('Pict', Ci.nsIFile).path; // works on windows
} catch (ex) {
try {
OSPath_saveDir = Services.dirsvc.get('Pct', Ci.nsIFile).path; // works on mac
} catch (ex) {
OSPath_saveDir = OS.Constants.Path.desktopDir;
}
}
}
};
Expand Down

0 comments on commit f61b7b3

Please sign in to comment.