зеркало из https://github.com/mozilla/pjs.git
Bug 552444 - Part 2: fix "UsrMicsumGens" dependency. r=mano
This commit is contained in:
Родитель
32db32c398
Коммит
2e807c97de
|
@ -99,15 +99,6 @@ DirectoryProvider::GetFile(const char *aKey, PRBool *aPersist, nsIFile* *aResult
|
|||
file.swap(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
else if (!strcmp(aKey, NS_APP_USER_MICROSUMMARY_DIR)) {
|
||||
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
|
||||
getter_AddRefs(file));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
file->AppendNative(NS_LITERAL_CSTRING("microsummary-generators"));
|
||||
file.swap(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
|
@ -54,10 +54,4 @@
|
|||
|
||||
#define NS_APP_EXISTING_PREF_OVERRIDE "ExistingPrefOverride"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Files and directories that exist on a per-profile basis.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define NS_APP_USER_MICROSUMMARY_DIR "UsrMicsumGens"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -34,25 +34,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
function test_usr_micsum() {
|
||||
let mdir = gProfD.clone();
|
||||
mdir.append("microsummary-generators");
|
||||
|
||||
let tmdir = gDirSvc.get("UsrMicsumGens", Ci.nsIFile);
|
||||
do_check_true(tmdir.equals(mdir));
|
||||
|
||||
if (!tmdir.exists())
|
||||
tmdir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777);
|
||||
|
||||
do_check_true(tmdir.isWritable());
|
||||
|
||||
let tfile = writeTestFile(tmdir, "usrmicsum");
|
||||
do_check_true(tfile.exists());
|
||||
|
||||
mdir.append(tfile.leafName);
|
||||
do_check_true(mdir.exists());
|
||||
}
|
||||
|
||||
function test_bookmarkhtml() {
|
||||
let bmarks = gProfD.clone();
|
||||
bmarks.append("bookmarks.html");
|
||||
|
@ -70,8 +51,7 @@ function test_prefoverride() {
|
|||
}
|
||||
|
||||
function run_test() {
|
||||
[test_usr_micsum,
|
||||
test_bookmarkhtml,
|
||||
[test_bookmarkhtml,
|
||||
test_prefoverride
|
||||
].forEach(function(f) {
|
||||
do_test_pending();
|
||||
|
|
|
@ -71,6 +71,8 @@ const ANNO_CONTENT_TYPE = "bookmarks/contentType";
|
|||
|
||||
const MAX_SUMMARY_LENGTH = 4096;
|
||||
|
||||
const USER_MICROSUMMARY_GENS_DIR = "microsummary-generators";
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
__defineGetter__("NetUtil", function() {
|
||||
|
@ -271,7 +273,8 @@ MicrosummaryService.prototype = {
|
|||
*/
|
||||
_cacheLocalGenerators: function MSS__cacheLocalGenerators() {
|
||||
// Load generators from the user's profile.
|
||||
var msDir = this._dirs.get("UsrMicsumGens", Ci.nsIFile);
|
||||
var msDir = this._dirs.get("ProfDS", Ci.nsIFile);
|
||||
msDir.append(USER_MICROSUMMARY_GENS_DIR);
|
||||
if (msDir.exists())
|
||||
this._cacheLocalGeneratorDir(msDir);
|
||||
},
|
||||
|
@ -413,7 +416,12 @@ MicrosummaryService.prototype = {
|
|||
topic = "microsummary-generator-installed";
|
||||
var generatorName = rootNode.getAttribute("name");
|
||||
var fileName = sanitizeName(generatorName) + ".xml";
|
||||
var file = this._dirs.get("UsrMicsumGens", Ci.nsIFile);
|
||||
var file = this._dirs.get("ProfDS", Ci.nsIFile);
|
||||
file.append(USER_MICROSUMMARY_GENS_DIR);
|
||||
if (!file.exists() || !file.isDirectory()) {
|
||||
file.create(Ci.nsIFile.DIRECTORY_TYPE, 0777);
|
||||
}
|
||||
|
||||
file.append(fileName);
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
|
||||
generator = new MicrosummaryGenerator(null,
|
||||
|
|
Загрузка…
Ссылка в новой задаче