зеркало из https://github.com/mozilla/gecko-dev.git
Back out changeset 6bc1a3d1a1ee (bug 519686 - multi-locale bookmarks)
This commit is contained in:
Родитель
02e5a2d5d2
Коммит
2573a2f2b1
|
@ -82,35 +82,22 @@ BrowserStartup.prototype = {
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/utils.js");
|
Cu.import("resource://gre/modules/utils.js");
|
||||||
|
|
||||||
try {
|
// Get bookmarks.html file location
|
||||||
let observer = {
|
let dirService = Cc["@mozilla.org/file/directory_service;1"].
|
||||||
onStreamComplete : function(aLoader, aContext, aStatus, aLength, aResult) {
|
getService(Ci.nsIProperties);
|
||||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
|
|
||||||
createInstance(Ci.nsIScriptableUnicodeConverter);
|
|
||||||
let jsonStr = "";
|
|
||||||
try {
|
|
||||||
converter.charset = "UTF-8";
|
|
||||||
jsonStr = converter.convertFromByteArray(aResult, aResult.length);
|
|
||||||
|
|
||||||
PlacesUtils.restoreBookmarksFromJSONString(jsonStr, true);
|
let bookmarksFile = dirService.get("profDef", Ci.nsILocalFile);
|
||||||
} catch (ex) {
|
bookmarksFile.append("bookmarks.json");
|
||||||
Cu.reportError("Failed to parse default bookmarks from bookmarks.json: " + err);
|
if (bookmarksFile.exists()) {
|
||||||
}
|
// import the file
|
||||||
}
|
try {
|
||||||
};
|
PlacesUtils.restoreBookmarksFromJSONFile(bookmarksFile);
|
||||||
|
} catch (err) {
|
||||||
let ioSvc = Cc["@mozilla.org/network/io-service;1"].
|
// Report the error, but ignore it.
|
||||||
getService(Ci.nsIIOService);
|
Cu.reportError("bookmarks.json file could be corrupt. " + err);
|
||||||
let uri = ioSvc.newURI("chrome://browser/locale/bookmarks.json", null, null);
|
}
|
||||||
let channel = ioSvc.newChannelFromURI(uri);
|
} else
|
||||||
let sl = Cc["@mozilla.org/network/stream-loader;1"].
|
Cu.reportError("Unable to find default bookmarks.json file.");
|
||||||
createInstance(Ci.nsIStreamLoader);
|
|
||||||
sl.init(observer);
|
|
||||||
channel.asyncOpen(sl, channel);
|
|
||||||
} catch (err) {
|
|
||||||
// Report the error, but ignore it.
|
|
||||||
Cu.reportError("Failed to load default bookmarks from bookmarks.json: " + err);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// nsIObserver
|
// nsIObserver
|
||||||
|
|
|
@ -103,14 +103,17 @@ installers-%: clobber-% langpack-% repackage-zip-%
|
||||||
|
|
||||||
NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
|
NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
|
||||||
|
|
||||||
bookmarks.json: bookmarks.inc generic/profile/bookmarks.json.in
|
%/defaults/profile/bookmarks.json: bookmarks.inc generic/profile/bookmarks.json.in
|
||||||
|
$(SYSINSTALL) -D $(dir $@)
|
||||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
|
||||||
-I $< \
|
-I $< \
|
||||||
-DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
|
-DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
|
||||||
$(srcdir)/generic/profile/bookmarks.json.in \
|
$(srcdir)/generic/profile/bookmarks.json.in \
|
||||||
> $@
|
> $@
|
||||||
|
|
||||||
libs realchrome:: bookmarks.json
|
libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.json ;
|
||||||
|
|
||||||
|
install:: $(DESTDIR)$(mozappdir)/defaults/profile/bookmarks.json ;
|
||||||
|
|
||||||
ifdef MOZ_UPDATER
|
ifdef MOZ_UPDATER
|
||||||
ifdef LOCALE_MERGEDIR
|
ifdef LOCALE_MERGEDIR
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
locale/@AB_CD@/browser/checkbox.dtd (%chrome/checkbox.dtd)
|
locale/@AB_CD@/browser/checkbox.dtd (%chrome/checkbox.dtd)
|
||||||
locale/@AB_CD@/browser/notification.dtd (%chrome/notification.dtd)
|
locale/@AB_CD@/browser/notification.dtd (%chrome/notification.dtd)
|
||||||
locale/@AB_CD@/browser/prompt.dtd (%chrome/prompt.dtd)
|
locale/@AB_CD@/browser/prompt.dtd (%chrome/prompt.dtd)
|
||||||
locale/@AB_CD@/browser/bookmarks.json (bookmarks.json)
|
|
||||||
|
|
||||||
# Fennec-specific overrides of generic strings
|
# Fennec-specific overrides of generic strings
|
||||||
* locale/@AB_CD@/browser/netError.dtd (%chrome/overrides/netError.dtd)
|
* locale/@AB_CD@/browser/netError.dtd (%chrome/overrides/netError.dtd)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче