Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- downbar.js.orig 2010-09-17 19:48:24.000000000 +0200
- +++ downbar.js 2010-09-17 19:58:41.000000000 +0200
- @@ -259,6 +259,22 @@
- win._dlbar_startUpdateMini();
- }
- },
- +
- + _dlbar_SetMetadata: function(aDownload) {
- + var cmd = '/usr/bin/xattr'
- + var execFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
- + var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
- +
- + // Arguments must be separated into an array
- + var args = ['-w', 'com.apple.metadata:kMDItemWhereFroms', "'"+aDownload.source.spec+"'", aDownload.targetFile.path ];
- +
- + execFile.initWithPath(cmd);
- + if (execFile.exists()) {
- + process.init(execFile);
- + process.run(false, args, args.length);
- + }
- + },
- +
- _dlbar_finishDownload : function(dl) {
- @@ -266,9 +282,9 @@
- //var fixedelmpath = elmpath.replace(/\\/g, "\\\\"); // The \ and ' get messed up in the command if they are not fixed
- //fixedelmpath = fixedelmpath.replace(/\'/g, "\\\'");
- var _dlbar_fileext = elmpath.split(".").pop().toLowerCase();
- + this._dlbar_SetMetadata(dl);
- +
- this._dlbar_dlCompleteSound(_dlbar_fileext);
- this._dlbar_AntiVirusScan(elmpath, _dlbar_fileext);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement