galeon r8936 - in trunk: . mozilla utils



Author: philipl
Date: Sat Feb  2 19:42:38 2008
New Revision: 8936
URL: http://svn.gnome.org/viewvc/galeon?rev=8936&view=rev

Log:
2008-02-02  Philip Langdale  <philipl alumni utexas net>

	D mozilla/gUrlCID.h
	D mozilla/nsMailtoUrl.cpp
	D mozilla/nsIMailtoUrl.h
	D mozilla/nsMailtoUrl.h
	* galeon.schemas.in
	* README.ExtraPrefs
	* utils/prefs-strings.h
	* mozilla/MozRegisterComponents.cpp
	* mozilla/ExternalProtocolService.cpp
	* mozilla/Makefile.am: Remove legacy mailer support. With
	the lack of symbols exported by 1.9, it's impossible to
	keep nsMailtoUrl compiling - and nowadays most people are
	using mailers that can parse mailto: urls.



Removed:
   trunk/mozilla/gUrlCID.h
   trunk/mozilla/nsIMailtoUrl.h
   trunk/mozilla/nsMailtoUrl.cpp
   trunk/mozilla/nsMailtoUrl.h
Modified:
   trunk/ChangeLog
   trunk/README.ExtraPrefs
   trunk/galeon.schemas.in
   trunk/mozilla/ExternalProtocolService.cpp
   trunk/mozilla/Makefile.am
   trunk/mozilla/MozRegisterComponents.cpp
   trunk/utils/prefs-strings.h

Modified: trunk/README.ExtraPrefs
==============================================================================
--- trunk/README.ExtraPrefs	(original)
+++ trunk/README.ExtraPrefs	Sat Feb  2 19:42:38 2008
@@ -166,18 +166,6 @@
 	Whether to open the downloader in a terminal
 	(default=false)
 
-Alternative Mail program:
-
-	/apps/galeon/Handlers/Programs/gnome_mailer (bool)
-	By default the GNOME mailer will be used, set this preference
-	to FALSE to use an alternative.
-	(default=true)
-
-	/apps/galeon/Handlers/Programs/mailer (string)
-	The program to use for handling mailto links when not using
-	the gnome-mailer (no default)
-	(See documentation for support % expansions)
-
 Misc
 ----
 

Modified: trunk/galeon.schemas.in
==============================================================================
--- trunk/galeon.schemas.in	(original)
+++ trunk/galeon.schemas.in	Sat Feb  2 19:42:38 2008
@@ -513,28 +513,6 @@
         </locale>
       </schema>
       <schema>
-        <key>/schemas/apps/galeon/Handlers/Programs/gnome_mailer</key>
-        <applyto>/apps/galeon/Handlers/Programs/gnome_mailer</applyto>
-        <owner>galeon</owner>
-        <type>bool</type>
-        <default>True</default>
-        <locale name="C">
-        <short>Use gnome protocol settings to handle mailto: links</short>
-        <long>Use gnome protocol settings handle mailto: links</long>
-        </locale>
-      </schema>
-      <schema>
-        <key>/schemas/apps/galeon/Handlers/Programs/mailer</key>
-        <applyto>/apps/galeon/Handlers/Programs/mailer</applyto>
-        <owner>galeon</owner>
-        <type>string</type>
-        <default></default>
-        <locale name="C">
-        <short>Program to use to handle mailto: links</short>
-        <long>Program to use to handle mailto: links</long>
-        </locale>
-      </schema>
-      <schema>
         <key>/schemas/apps/galeon/Handlers/Downloading/external_downloader</key>
         <applyto>/apps/galeon/Handlers/Downloading/external_downloader</applyto>
         <owner>galeon</owner>

Modified: trunk/mozilla/ExternalProtocolService.cpp
==============================================================================
--- trunk/mozilla/ExternalProtocolService.cpp	(original)
+++ trunk/mozilla/ExternalProtocolService.cpp	Sat Feb  2 19:42:38 2008
@@ -19,7 +19,6 @@
 #include "config.h"
 #endif
 
-#include <nsIMailtoUrl.h>
 #include <nsCOMPtr.h>
 #include <nsIURI.h>
 #include <nsIDOMWindow.h>
@@ -35,7 +34,6 @@
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkmessagedialog.h>
 
-#include "gUrlCID.h"
 #include "ExternalProtocolService.h"
 #include "GulString.h"
 
@@ -43,9 +41,6 @@
 #include "eel-gconf-extensions.h"
 
 #define WINDOWWATCHER_CONTRACTID "@mozilla.org/embedcomp/window-watcher;1"
-static NS_DEFINE_CID(kMailtoURLCID, NS_MAILTOURL_CID);
-
-static void OpenLegacyMailer(char *format, nsIMailtoUrl *aURL);
 
 /* Implementation file */
 #ifdef HAVE_NSPIEXTERNALPROTOCOLSERVICE
@@ -136,28 +131,6 @@
 		}
 	}
 
-	if (cScheme.Equals("mailto") && 
-	    !eel_gconf_get_boolean (CONF_PROGRAMS_GNOME_MAILER))
-	{
-		char *mailer;
-		nsCOMPtr<nsIMailtoUrl> mailUrl = do_CreateInstance (NS_MAILTOURL_CONTRACTID);
-		if (!mailUrl) return NS_ERROR_FAILURE;
-		
-		nsCOMPtr <nsIURI> newUri = do_QueryInterface (mailUrl);
-		if (!newUri) return NS_ERROR_FAILURE;
-		
-		newUri->SetSpec (cSpec);
-		
-		mailer = eel_gconf_get_string (CONF_PROGRAMS_MAILER);
-		if (!mailer) return NS_ERROR_FAILURE;
-
-		OpenLegacyMailer (mailer, mailUrl);
-
-		g_free (mailer);
-			
-		return NS_OK;
-	}
-
 	/* build the config key */
 	char *key = g_strconcat ("/desktop/gnome/url-handlers/",
 				 cScheme.get(),
@@ -165,7 +138,7 @@
 	/* find it */
 	char *result = eel_gconf_get_string (key);
 	g_free (key);
-	
+
 	if (result)
 	{
 		gnome_url_show(cSpec.get(), NULL);
@@ -179,7 +152,7 @@
 	if (NS_FAILED (rv)) return rv;
 
 	GtkWidget *dialog;
-	
+
 	/* throw the error */
 	dialog = gtk_message_dialog_new (NULL, (GtkDialogFlags)0, 
 					 GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
@@ -187,7 +160,7 @@
 					   "and no GNOME default handler is set"));
 	gtk_dialog_run (GTK_DIALOG(dialog));
 	gtk_widget_destroy (dialog);
-		
+
 	/* don't let mozilla try blindly */
 	return NS_ERROR_FAILURE;
 }
@@ -208,191 +181,3 @@
 }
 #endif
 
-/*
- * Open a legacy mailer according to preferences command
- *
- * Options:
- *
- * %t To
- * %c Cc
- * %b Bcc
- * %k Organization
- * %w News host
- * %n News group
- * %p Priority
- * %a Attachment
- * %e Reference
- * %h Html
- * %y Body
- * %s Subject
- * %r Reply
- * %o Follow up
- * [ ] ignore all content if the part is null
- */
-static void OpenLegacyMailer(char *format, nsIMailtoUrl *aURL)
-{
-	gchar *ToPart, *CcPart, *BccPart, *FromPart, 
-		*FollowUpToPart, *OrganizationPart, 
-		*ReplyToPart, *SubjectPart, *BodyPart, 
-		*HtmlPart, *ReferencePart, *AttachmentPart, 
-		*PriorityPart, *NewsgroupPart, *NewsHostPart;
-	/* FIXME not used */
-	gboolean forcePlainText;
-	
-	int length, i, j, subpos = -1;
-	char *copy, *command;
-
-	aURL->GetMessageContents (&ToPart, 
-				  &CcPart, 
-				  &BccPart, 
-				  &FromPart, 
-				  &FollowUpToPart, 
-				  &OrganizationPart, 
-				  &ReplyToPart, 
-				  &SubjectPart, 
-				  &BodyPart, 
-				  &HtmlPart, 
-				  &ReferencePart, 
-				  &AttachmentPart, 
-				  &PriorityPart, 
-				  &NewsgroupPart, 
-				  &NewsHostPart, 
-				  &forcePlainText);
-
-	/* get the format string */
-        length = strlen (format);
-	
-	int mem = length;
-	mem += ToPart != NULL ? strlen (ToPart) : 0;
-	mem += CcPart != NULL ? strlen (CcPart) : 0;
-	mem += FromPart != NULL ? strlen (FromPart) : 0;
-	mem += FollowUpToPart != NULL ? strlen (FollowUpToPart) : 0;
-	mem += OrganizationPart != NULL ? strlen (OrganizationPart) : 0;
-	mem += ReplyToPart != NULL ? strlen (ReplyToPart) : 0;
-	mem += SubjectPart != NULL ? strlen (SubjectPart) : 0;
-	mem += BodyPart != NULL ? strlen (BodyPart) : 0;
-	mem += HtmlPart != NULL ? strlen (HtmlPart) : 0;
-	mem += ReferencePart != NULL ? strlen (ReferencePart) : 0;
-	mem += AttachmentPart != NULL ? strlen (AttachmentPart) : 0;
-	mem += PriorityPart != NULL ? strlen (PriorityPart) : 0;
-	mem += NewsgroupPart != NULL ? strlen (NewsgroupPart) : 0;
-	mem += NewsHostPart != NULL ? strlen (NewsHostPart) : 0;
-	mem += BccPart != NULL ? strlen (BccPart) : 0;
-	
-	/* make a target string of maximal size */
-        command = (char *) g_malloc (mem);
-                                  
-        /* parse the format string doing substitutions */
-        for (i = 0, j = 0; i < length; i++)
-        {
-		if (format[i] == '[')
-		{
-			subpos = j;
-		}
-		else if (format[i] == ']')
-		{
-			subpos = -1;
-		}
-		else if (format[i] == '%' && (i == 0 || format[i - 1] != '\\'))
-                {
-                        /* check the format character */
-                        switch (format[++i])
-                        {
-                        case 'k':
-                                copy = OrganizationPart;
-                                break;
-                        case 'w':
-                                copy = NewsHostPart;
-                                break;
-                        case 'n':
-                                copy = NewsgroupPart;
-                                break;
-                        case 'p':
-                                copy = PriorityPart;
-                                break;
-                        case 'a':
-                                copy = AttachmentPart;
-                                break;
-                        case 'e':
-                                copy = ReferencePart;
-                                break;
-                        case 'h':
-                                copy = HtmlPart;
-                                break;
-                        case 'y':
-                                copy = BodyPart;
-                                break;
-                        case 's':
-                                copy = SubjectPart;
-                                break;
-                        case 'r':
-                                copy = ReplyToPart;
-                                break;
-                        case 'o':
-                                copy = FollowUpToPart;
-                                break;
-                        case 'f':
-                                copy = FromPart;
-                                break;
-                        case 't':
-                                copy = ToPart;
-                                break;
-                        case 'c':
-                                copy = CcPart;
-                                break;
-                        case 'b':
-                                copy = BccPart;
-                                break;
-                        default:
-                                copy = NULL;
-                                break;
-                        }
-                        
-                        /* copy substitute string */
-                        if (copy != NULL && strlen (copy) > 0)
-                        {
-				strcpy (command + j, copy);
-                                j += strlen (copy);
-                        }
-			else
-			{
-				if (subpos>0)
-				{
-					j = subpos - 1;
-					while (i<length &&
-					       format[i] != ']')
-					{
-						i++;
-					}
-					subpos = -1;
-				}
-			}
-                }
-                else
-                {
-                        command[j++] = format[i];
-                }
-        }
-        command[j] = '\0';
-
-        /* execute the command */
-        gnome_execute_shell (NULL, command);
-        
-        /* free allocated strings */
-	g_free (command);
-        nsMemory::Free (ToPart);
-	nsMemory::Free (CcPart); 
-	nsMemory::Free (BccPart);
-	nsMemory::Free (FromPart);
-	nsMemory::Free (FollowUpToPart);
-	nsMemory::Free (OrganizationPart);
-	nsMemory::Free (ReplyToPart);
-	nsMemory::Free (SubjectPart);
-	nsMemory::Free (BodyPart);
-	nsMemory::Free (HtmlPart);
-	nsMemory::Free (ReferencePart);
-	nsMemory::Free (AttachmentPart);
-	nsMemory::Free (PriorityPart);
-	nsMemory::Free (NewsgroupPart);
-	nsMemory::Free (NewsHostPart);
-}

Modified: trunk/mozilla/Makefile.am
==============================================================================
--- trunk/mozilla/Makefile.am	(original)
+++ trunk/mozilla/Makefile.am	Sat Feb  2 19:42:38 2008
@@ -83,10 +83,6 @@
 	mozilla-encodings.h		\
 	mozilla-i18n.c			\
 	mozilla-i18n.h			\
-	nsIMailtoUrl.h          	\
-	nsMailtoUrl.cpp         	\
-	nsMailtoUrl.h           	\
-	gUrlCID.h               	\
 	AutoJSContextStack.cpp		\
 	AutoJSContextStack.h		\
 	ContentHandler.cpp		\

Modified: trunk/mozilla/MozRegisterComponents.cpp
==============================================================================
--- trunk/mozilla/MozRegisterComponents.cpp	(original)
+++ trunk/mozilla/MozRegisterComponents.cpp	Sat Feb  2 19:42:38 2008
@@ -42,9 +42,7 @@
 #endif
 
 #include "ExternalProtocolService.h"
-#include "gUrlCID.h"
 #include "GaleonAboutModule.h"
-#include "nsMailtoUrl.h"
 
 #ifdef HAVE_NSICLASSINFOIMPL_H
 #include <nsIClassInfoImpl.h>
@@ -83,8 +81,6 @@
 #ifdef HAVE_NSIJSCONSOLESERVICE_H
 NS_GENERIC_FACTORY_CONSTRUCTOR(JSConsoleService)
 #endif
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailtoUrl);
-static NS_DEFINE_CID(kMailtoUrlCID, NS_MAILTOURL_CID);
 
 // NS_DOWNLOAD_CONTRACTID was renamed in mozilla 1.8b
 #ifndef NS_TRANSFER_CONTRACTID
@@ -245,12 +241,6 @@
 		EphyPromptServiceConstructor
 	},
 #endif /* HAVE_NSINONBLOCKINGALERTSERVICE_H */
-	{
-		NS_MAILTOURL_CLASSNAME,
-		NS_MAILTOURL_CID,
-		NS_MAILTOURL_CONTRACTID,
-		nsMailtoUrlConstructor
-	}
 };
 
 #define NS_MSGCONTENTPOLICY_CONTRACTID "@mozilla.org/messenger/content-policy;1"
@@ -317,17 +307,6 @@
 	NS_GetComponentManager (getter_AddRefs (cm));
 	NS_ENSURE_TRUE (cm, FALSE);
 
-	guint numAppComps = G_N_ELEMENTS (sAppComps);
-
-	/* See if we should register the nsMailtoUrl handler */
-	PRBool isMailtoUrlReg;
-	rv = cr->IsContractIDRegistered(NS_MAILTOURL_CONTRACTID,
-					&isMailtoUrlReg);
-	if (NS_SUCCEEDED(rv) && isMailtoUrlReg)
-	{
-		numAppComps--; /* No */
-	}
-
 	for (guint i = 0; i < G_N_ELEMENTS (sAppComps); i++)
 	{
 		nsCOMPtr<nsIGenericFactory> componentFactory;

Modified: trunk/utils/prefs-strings.h
==============================================================================
--- trunk/utils/prefs-strings.h	(original)
+++ trunk/utils/prefs-strings.h	Sat Feb  2 19:42:38 2008
@@ -40,8 +40,6 @@
 #define CONF_TOOLBAR_STYLE "/apps/galeon/UI/Toolbar/toolbar_override_style"
 
 /* External apps */
-#define CONF_PROGRAMS_GNOME_MAILER "/apps/galeon/Handlers/Programs/gnome_mailer"
-#define CONF_PROGRAMS_MAILER "/apps/galeon/Handlers/Programs/mailer"
 #define CONF_DOWNLOADING_ASK_DIR "/apps/galeon/Handlers/Downloading/ask_for_download_dir"
 #define CONF_DOWNLOADING_SHOW_DETAILS "/apps/galeon/Handlers/Downloading/show_details"
 #define CONF_DOWNLOADING_EXTERNAL_DOWNLOADER "/apps/galeon/Handlers/Downloading/external_downloader"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]