Closed
Bug 739056
Opened 13 years ago
Closed 11 years ago
Port |Bug 715099 - Convert nsProfileMigrator to JS so we can use JS modules on migration| to SeaMonkey
Categories
(SeaMonkey :: Startup & Profiles, defect)
SeaMonkey
Startup & Profiles
Tracking
(seamonkey2.9 wontfix, seamonkey2.10 wontfix, seamonkey2.11 wontfix, seamonkey2.12 wontfix)
RESOLVED
FIXED
seamonkey2.23
People
(Reporter: sgautherie, Assigned: ewong)
References
Details
Attachments
(1 file, 7 obsolete files)
(deleted),
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Updated•13 years ago
|
status-seamonkey2.11:
--- → affected
tracking-seamonkey2.10:
--- → ?
tracking-seamonkey2.9:
? → ---
Target Milestone: seamonkey2.11 → ---
Reporter | ||
Updated•13 years ago
|
status-seamonkey2.12:
--- → affected
tracking-seamonkey2.10:
? → ---
tracking-seamonkey2.11:
--- → ?
Assignee | ||
Comment 1•12 years ago
|
||
tracking-seamonkey2.11:
? → ---
Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 642467 [details] [diff] [review]
Convert nsProfileMigrator to JS. (v1)
patch has been bitrotted. will come up with an updated patch.
Attachment #642467 -
Flags: review?(neil)
Assignee | ||
Updated•11 years ago
|
Attachment #642467 -
Attachment is obsolete: true
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #775048 -
Flags: review?(neil)
Comment 4•11 years ago
|
||
Comment on attachment 775048 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v2)
>-#include "nsThunderbirdProfileMigrator.h"
You removed the Thunderbird migrator, but you didn't replace it with anything... probably because there isn't anything for you to copy from ;-)
>+++ b/suite/profile/migration/src/ProfileMigrator.js
Just skimmed this file for now...
>+ _toCString: function PM__toCString(aStr) {
>+ let cstr = Components.classes["@mozilla.org/supports-cstring;1"]
>+ .createInstance(Components.interfaces.nsISupportsCString);
>+ cstr.data = aStr;
>+ return cstr;
>+ },
I guess you just copied this, but in fact there's no reason to use a CString here, a normal String would be fine.
>+ let cid = "@mozilla.org/profile/migrator;1?app=browser&type=" + aKey;
app=suite (!)
>+component {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A} ProfileMigrator.js
I hope this is a new CID.
>++contract @mozilla.org/toolkit/profile-migrator;1 {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A}
++?
>\ No newline at end of file
Oops.
>+EXTRA_PP_COMPONENTS += [
>+ 'ProfileMigrator.js' ,
>+ 'SuiteProfileMigrator.manifest' ,
Don't need to preprocess the manifest. Well, not yet, anyway.
Comment 5•11 years ago
|
||
Comment on attachment 775048 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v2)
>+ .nsIBrowserProfileMigrator);
nsISuiteProfileMigrator
>+ // We don't yet support checking for the default browser on all platforms,
>+ // needless to say we don't have migrators for all browsers. Thus, for each
>+ // platform, there's a fallback list of migrators used in these cases.
>+ _PLATFORM_FALLBACK_LIST:
>+#ifdef XP_WIN
>+ ["ie", "chrome", /* safari */],
>+#elifdef XP_MACOSX
>+ ["safari", "chrome"],
>+#else
>+ ["chrome"],
>+#endif
SeaMonkey's platform fallback list is just ["thunderbird"] on all platforms, we don't have any browser migrators (yet!)
>+ let defaultBrowser = "";
...
>+ if (defaultBrowser)
>+ migratorsOrdered.sort(function(a, b) b == defaultBrowser ? 1 : 0);
So for now all this has to be wrapped in an #if 0 block.
>+ for (let i = 0; i < migratorsOrdered.length; i++) {
>+ let migrator = this._getMigratorIfSourceExists(migratorsOrdered[i]);
>+ if (migrator)
>+ return [migratorsOrdered[i], migrator];
>+ }
[Isn't there a better way of doing this using for let key of?]
Attachment #775048 -
Flags: review?(neil) → review-
Reporter | ||
Updated•11 years ago
|
Assignee | ||
Comment 6•11 years ago
|
||
This patch isn't compiling. Would like to have feedback as to what I'm doing wrong.
Attachment #775048 -
Attachment is obsolete: true
Flags: needinfo?(neil)
Assignee | ||
Updated•11 years ago
|
Attachment #778241 -
Attachment description: bug_739056.diff → Convert nsProfileMigrator to JS.
Assignee | ||
Comment 7•11 years ago
|
||
This patch has a fix for the missing {}, but it's still not the
reason why it's not building. Any idea?
Attachment #778241 -
Attachment is obsolete: true
Assignee | ||
Comment 8•11 years ago
|
||
Fixed the error. Needed to add EXTRA_COMPONENTS to moz.build.
Attachment #778313 -
Attachment is obsolete: true
Attachment #778325 -
Flags: review?(neil)
Flags: needinfo?(neil)
Comment 9•11 years ago
|
||
(In reply to comment #4)
> >-#include "nsThunderbirdProfileMigrator.h"
> You removed the Thunderbird migrator, but you didn't replace it with
> anything... probably because there isn't anything for you to copy from ;-)
Sorry, what I meant was that you shouldn't remove it because you didn't have a replacement.
> >+component {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A} ProfileMigrator.js
> I hope this is a new CID.
Even better, you used the same CID in all three places!
(In reply to comment #5)
> >+ let defaultBrowser = "";
> ...
> >+ if (defaultBrowser)
> >+ migratorsOrdered.sort(function(a, b) b == defaultBrowser ? 1 : 0);
> So for now all this has to be wrapped in an #if 0 block.
[My idea was to wrap the quoted section, rather than changing the existing block...]
> >+ for (let i = 0; i < migratorsOrdered.length; i++) {
> >+ let migrator = this._getMigratorIfSourceExists(migratorsOrdered[i]);
> >+ if (migrator)
> >+ return [migratorsOrdered[i], migrator];
> >+ }
> [Isn't there a better way of doing this using for let key of?]
... and you used let key in?
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #778325 -
Attachment is obsolete: true
Attachment #778325 -
Flags: review?(neil)
Attachment #779662 -
Flags: review?(neil)
Comment 11•11 years ago
|
||
Comment on attachment 779662 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v6)
>- { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID },
>- { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
Need to restore the Thunderbird profile migrator here too.
>+ for (let key in migratorsOrdered) {
Still not using let key of.
> CPP_SOURCES += [
>+ 'nsSuiteProfileMigratorUtils.cpp',
> 'nsNetscapeProfileMigratorBase.cpp',
>- 'nsProfileMigrator.cpp',
>- 'nsSuiteProfileMigratorUtils.cpp',
> 'nsThunderbirdProfileMigrator.cpp',
Aren't these supposed to be in alphabetical order?
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #779662 -
Attachment is obsolete: true
Attachment #779662 -
Flags: review?(neil)
Attachment #780156 -
Flags: review?(neil)
Comment 13•11 years ago
|
||
(In reply to comment #11)
> (From update of attachment 779662 [details] [diff] [review])
> >- { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID },
> >- { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
> Need to restore the Thunderbird profile migrator here too.
Oops. It turns out that NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX lives in nsProfileMigrator.h which is one of the files you removed...
Comment 14•11 years ago
|
||
Comment on attachment 780156 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v7)
>-#define NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "@mozilla.org/profile/migrator;1?app=suite&type="
Looks like the best fix is to add this line to nsSuiteModule.cpp just before the row of /s (with blank lines for clarity of course).
Comment 15•11 years ago
|
||
Comment on attachment 780156 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v7)
>+let NSGetFactory = XPCOMUtils.generateNSGetFactory([SuiteProfileMigrator]);
The object is just called ProfileMigrator.
Comment 16•11 years ago
|
||
Comment on attachment 780156 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v7)
>+ for (key of migratorsOrdered) {
Nit: this needs a let.
>+ QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISuiteProfileMigrator]),
This needs to be nsIProfileMigrator.
Comment 17•11 years ago
|
||
Comment on attachment 780156 [details] [diff] [review]
Convert nsProfileMigrator to JS.. (v7)
r- as per above comments. (But once those are fixed, then it seems to work.)
Attachment #780156 -
Flags: review?(neil) → review-
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #780156 -
Attachment is obsolete: true
Attachment #780722 -
Flags: review?(neil)
Updated•11 years ago
|
Attachment #780722 -
Flags: review?(neil) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 19•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.22
Updated•11 years ago
|
Target Milestone: seamonkey2.22 → seamonkey2.23
You need to log in
before you can comment on or make changes to this bug.
Description
•