diff --git a/mailnews/mime/emitters/xml/nsMimeEmitter.cpp b/mailnews/mime/emitters/xml/nsMimeEmitter.cpp index 5c032157fa5f..fed5bd0dafbd 100644 --- a/mailnews/mime/emitters/xml/nsMimeEmitter.cpp +++ b/mailnews/mime/emitters/xml/nsMimeEmitter.cpp @@ -79,12 +79,18 @@ nsMimeEmitter::nsMimeEmitter() mReallyOutput = PR_FALSE; #endif +#ifdef NS_DEBUG +printf("Prefs not working on multiple threads...must find a solution\n"); +#endif + + mHeaderDisplayType = AllHeaders; + return; + nsresult rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&(mPrefs)); if (! (mPrefs && NS_SUCCEEDED(rv))) return; mPrefs->Startup("prefs.js"); - mHeaderDisplayType = AllHeaders; mPrefs->GetIntPref("mail.show_headers", &mHeaderDisplayType); } diff --git a/mailnews/mime/src/mimei.cpp b/mailnews/mime/src/mimei.cpp index a5ab37f0ba90..2b2c695fc867 100644 --- a/mailnews/mime/src/mimei.cpp +++ b/mailnews/mime/src/mimei.cpp @@ -631,7 +631,8 @@ mime_create (const char *content_type, MimeHeaders *hdrs, { nsIPref *pref = GetPrefServiceManager(opts); // Pref service manager - pref->GetBoolPref("mailnews.autolookup_unknown_mime_types",&reverse_lookup); + if (pref) + pref->GetBoolPref("mailnews.autolookup_unknown_mime_types",&reverse_lookup); got_lookup_pref = PR_TRUE; } diff --git a/mailnews/mime/src/mimemoz2.cpp b/mailnews/mime/src/mimemoz2.cpp index e888bd308ede..cef39145d150 100644 --- a/mailnews/mime/src/mimemoz2.cpp +++ b/mailnews/mime/src/mimemoz2.cpp @@ -1037,14 +1037,15 @@ mime_bridge_create_stream(MimePluginInstance *newPluginObj, return NULL; } + /*** nsresult rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&(msd->prefs)); if (! (msd->prefs && NS_SUCCEEDED(rv))) { PR_FREEIF(msd); return NULL; } - msd->prefs->Startup(MIME_PREFS_FILE); + ***/ // Assign the new mime emitter - will handle output operations msd->output_emitter = newEmitter; @@ -1122,16 +1123,19 @@ mime_bridge_create_stream(MimePluginInstance *newPluginObj, // Get the libmime prefs... MIME_NoInlineAttachments = PR_TRUE; - msd->prefs->GetBoolPref("mail.inline_attachments", &MIME_NoInlineAttachments); + if (msd->prefs) + msd->prefs->GetBoolPref("mail.inline_attachments", &MIME_NoInlineAttachments); MIME_NoInlineAttachments = !MIME_NoInlineAttachments; /* This pref is written down in with the opposite sense of what we like to use... */ MIME_WrapLongLines = PR_FALSE; - msd->prefs->GetBoolPref("mail.wrap_long_lines", &MIME_WrapLongLines); + if (msd->prefs) + msd->prefs->GetBoolPref("mail.wrap_long_lines", &MIME_WrapLongLines); MIME_VariableWidthPlaintext = PR_TRUE; - msd->prefs->GetBoolPref("mail.fixed_width_messages", &MIME_VariableWidthPlaintext); + if (msd->prefs) + msd->prefs->GetBoolPref("mail.fixed_width_messages", &MIME_VariableWidthPlaintext); MIME_VariableWidthPlaintext = !MIME_VariableWidthPlaintext; msd->options->no_inline_p = MIME_NoInlineAttachments;