Fix bug 546300 - Octal Numeric Constants are deprecated. r=markus

--HG--
extra : rebase_source : a60d26b4f291cb87ec3b7c1a99e8955b298d0434
This commit is contained in:
Philipp Kewisch 2010-02-18 15:27:24 +01:00
Родитель 75ba1e51b3
Коммит 796b05279b
8 изменённых файлов: 27 добавлений и 15 удалений

Просмотреть файл

@ -289,7 +289,10 @@ calDNDBaseObserver.prototype = {
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(localFileInstance, MODE_RDONLY, 0444, {});
inputStream.init(localFileInstance,
MODE_RDONLY,
parseInt("0444", 8),
{});
try {
//XXX support csv

Просмотреть файл

@ -107,7 +107,7 @@ function loadEventsFromFile(aCalendar) {
let items = [];
try {
inputStream.init( fp.file, MODE_RDONLY, 0444, {});
inputStream.init( fp.file, MODE_RDONLY, parseInt("0444", 8), {});
items = importer.importFromStream(inputStream, {});
} catch(ex) {
switch (ex.result) {
@ -302,7 +302,11 @@ function saveEventsToFile(calendarEventArray, aDefaultFileName) {
outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(nsIFileOutputStream);
try {
outputStream.init(localFileInstance, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, 0664, 0);
outputStream.init(localFileInstance,
MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE,
parseInt("0664", 8),
0);
// XXX Do the right thing with unicode and stuff. Or, again, should the
// exporter handle that?
exporter.exportToStream(outputStream,

Просмотреть файл

@ -484,7 +484,7 @@ var gDataMigrator = {
var fileStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
.createInstance(Components.interfaces.nsIFileInputStream);
fileStream.init(dataStore, 0x01, 0444, {});
fileStream.init(dataStore, 0x01, parseInt("0444", 8), {});
var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
.getService(Components.interfaces.nsIConverterInputStream);
convStream.init(fileStream, 'UTF-8', 0, 0x0000);
@ -509,12 +509,13 @@ var gDataMigrator = {
}
var tempFile = gDataMigrator.dirService.get("TmpD", Components.interfaces.nsIFile);
tempFile.append("icalTemp.ics");
tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
parseInt("0600", 8));
var tempUri = gDataMigrator.ioService.newFileURI(tempFile);
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
stream.init(tempFile, 0x2A, 0600, 0);
stream.init(tempFile, 0x2A, parseInt("0600", 8), 0);
var convStream = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
.createInstance(Components.interfaces.nsIConverterOutputStream);
convStream.init(stream, 'UTF-8', 0, 0x0000);
@ -624,7 +625,7 @@ var gDataMigrator = {
var items = [];
try {
inputStream.init(icsFile, MODE_RDONLY, 0444, {});
inputStream.init(icsFile, MODE_RDONLY, parseInt("0444", 8), {});
items = icsImporter.importFromStream(inputStream, {});
} catch(ex) {
switch (ex.result) {

Просмотреть файл

@ -262,7 +262,8 @@ function getCalendarDirectory() {
dir.append("calendar-data");
if (!dir.exists()) {
try {
dir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0700);
dir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE,
parseInt("0700", 8));
} catch (exc) {
ASSERT(false, exc);
throw exc;

Просмотреть файл

@ -374,7 +374,8 @@ calItipEmailTransport.prototype = {
.createInstance(Components.interfaces.nsIProperties);
var tempFile = dirUtils.get("TmpD", Components.interfaces.nsIFile);
tempFile.append("itipTemp");
tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600);
tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
parseInt("0600", 8));
var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
@ -384,7 +385,8 @@ calItipEmailTransport.prototype = {
const MODE_TRUNCATE = 0x20;
outputStream.init(tempFile,
MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE,
0600, 0);
parseInt("0600", 8),
0);
outputStream.write(mailText, mailText.length);
outputStream.close();

Просмотреть файл

@ -604,7 +604,8 @@ calICSCalendar.prototype = {
function makeDailyFileName() {
var dailyBackupFile = backupDir.clone();
dailyBackupFile.append(makeName('day'));
dailyBackupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE, 0600);
dailyBackupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE,
parseInt("0600", 8));
dailyBackupFileName = dailyBackupFile.leafName;
// Remove the reference to the nsIFile, because we need to
@ -687,7 +688,7 @@ calICSCalendar.prototype = {
var backupDir = cal.getCalendarDirectory();
backupDir.append("backup");
if (!backupDir.exists()) {
backupDir.create(CI.nsIFile.DIRECTORY_TYPE, 0755);
backupDir.create(CI.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
}
} catch(e) {
// Backup dir wasn't found. Likely because we are running in
@ -733,7 +734,7 @@ calICSCalendar.prototype = {
var backupFile = backupDir.clone();
backupFile.append(makeName('edit'));
backupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE, 0600);
backupFile.createUnique(CI.nsIFile.NORMAL_FILE_TYPE, parseInt("0600", 8));
purgeOldBackups();

Просмотреть файл

@ -72,7 +72,7 @@ function initLogging() {
0x08 /* PR_CREATE_FILE */ |
(getPref("calendar.wcap.log_file_append", false)
? 0x10 /* PR_APPEND */ : 0x20 /* PR_TRUNCATE */),
0700 /* read, write, execute/search by owner */,
parseInt("0700", 8) /* read, write, execute/search by owner */,
0 /* unused */);
initLogging.mLogFilestream = logFileStream;
} catch (exc) {

Просмотреть файл

@ -71,7 +71,7 @@ function createStream(file, createOutputStream) {
0x02 /* PR_WRONLY */ |
0x08 /* PR_CREATE_FILE */ |
0x20 /* PR_TRUNCATE */,
0700 /* read, write, execute/search by owner */,
parseInt("0700", 8) /* read, write, execute/search by owner */,
0 /* unused */);
} else {
stream = Components.classes["@mozilla.org/network/file-input-stream;1"]