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