thunderbird/thunderbird-1.5-profile-migrator.patch
Christopher Aillon bf7b1b1877 %changelog
Thu Dec 21 2006 Behdad Esfahbod <besfahbo@redhat.com> 1.5.0.9-5
- Added firefox-1.5-pango-underline.patch
Wed Dec 20 2006 Behdad Esfahbod <besfahbo@redhat.com> 1.5.0.9-4
- Added firefox-1.5-pango-justified-range.patch
Tue Dec 19 2006 Behdad Esfahbod <besfahbo@redhat.com> 1.5.0.9-3
- Added firefox-1.5-pango-cursor-position-more.patch
Tue Dec 19 2006 Matthias Clasen <mclasen@redhat.com> 1.5.0.9-2
- Add a Requires: launchmail (#219884)
Tue Dec 19 2006 Christopher Aillon <caillon@redhat.com> 1.5.0.9-1
- Update to 1.5.0.9
- Take firefox's pango fixes
- Don't offer to import...nothing.
2006-12-23 21:05:09 +00:00

74 lines
2.2 KiB
Diff

Index: mozilla/mail/components/migration/src/nsProfileMigrator.cpp
===================================================================
RCS file: /cvsroot/mozilla/mail/components/migration/src/nsProfileMigrator.cpp,v
retrieving revision 1.9
diff -pu -r1.9 mozilla/mail/components/migration/src/nsProfileMigrator.cpp
--- mozilla/mail/components/migration/src/nsProfileMigrator.cpp
+++ mozilla/mail/components/migration/src/nsProfileMigrator.cpp
@@ -131,24 +131,55 @@ nsProfileMigrator::GetDefaultMailMigrato
// if we are being forced to migrate to a particular migration type, then create an instance of that migrator
// and return it.
+ NS_NAMED_LITERAL_CSTRING(migratorPrefix,
+ NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX);
+ nsCAutoString migratorID;
if (forceMigrationType.get())
{
PRBool exists = PR_FALSE;
- nsCAutoString migratorID (NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX);
+ migratorID = migratorPrefix;
migratorID.Append(forceMigrationType);
mailMigrator = do_CreateInstance(migratorID.get());
-
- if (mailMigrator)
+ if (!mailMigrator)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ mailMigrator->GetSourceExists(&exists);
+ /* trying to force migration on a source which doesn't
+ * have any profiles.
+ */
+ if (!exists)
+ return NS_ERROR_NOT_AVAILABLE;
+ aKey = forceMigrationType;
+ return NS_OK;
+ }
+
+ #define MAX_SOURCE_LENGTH 10
+ const char sources[][MAX_SOURCE_LENGTH] = {
+ "seamonkey",
+ "oexpress",
+ "outlook",
+ "dogbert",
+ "eudora",
+ 0
+ };
+ for (PRUint32 i = 0; sources[i]; ++i)
+ {
+ migratorID = migratorPrefix;
+ migratorID.Append(sources[i]);
+ mailMigrator = do_CreateInstance(migratorID.get());
+ if (!mailMigrator)
+ continue;
+
+ PRBool exists = PR_FALSE;
+ mailMigrator->GetSourceExists(&exists);
+ if (exists)
{
- mailMigrator->GetSourceExists(&exists);
- if (exists)
- aKey = forceMigrationType;
- else
- rv = NS_ERROR_FAILURE; // trying to force migration on a source which does not have any profiles
+ mailMigrator = nsnull;
+ return NS_OK;
}
}
- return rv;
+ return NS_ERROR_NOT_AVAILABLE;
}
NS_IMETHODIMP