Changeset 2835

Show
Ignore:
Timestamp:
10/15/07 02:17:59
Author:
jdapena
Message:

* m4/moz.m4:

        • Reworked mozilla detection. Now we know if the mozilla
          engine is based on 1.8 or 1.9 code.

* configure.ac:

        • Use again includes for nspr and nss

* libtinymailui-mozembed/Makefile.am:

        • Use again the mozilla preferences code, as it will hide the
          mozilla 1.8 compatibility code.

* tny-moz-embed-html-mime-part-view.c:

        • Move all the mozembed setup code to mozilla-preferences. There
          I'll set specific mozilla code to add compatibility with
          mozilla 1.8.

* libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c:

        • Fix crash when the keyring function returns no matches in
          keyring, but it returns ok.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/config.h.in

    r2829 r2835  
    3131#undef HAVE_MEMORY_H 
    3232 
     33/* Define if we have mozilla api 1.8 */ 
     34#undef HAVE_MOZILLA_1_8 
     35 
     36/* Define if we have mozilla api 1.9 */ 
     37#undef HAVE_MOZILLA_1_9 
     38 
    3339/* Define to 1 if you have the <stdint.h> header file. */ 
    3440#undef HAVE_STDINT_H 
     
    5460/* "Whether to hack the TnyMaemoConicDevice to somewhat work in sbox" */ 
    5561#undef MAEMO_CONIC_DUMMY 
     62 
     63/* Detected mozilla engine version for mozembed */ 
     64#undef MOZEMBED_MOZILLA_VERSION 
    5665 
    5766/* "The path of the mozilla engine" */ 
  • trunk/configure.ac

    r2829 r2835  
    375375  AC_TNY_MOZ_CHECK 
    376376 
     377  if test x$mozilla_nspr = xno; then 
     378   AC_MSG_ERROR("You need Mozilla's NSPR") 
     379  fi 
     380 
     381  if test x$mozilla_nss = xno; then 
     382   AC_MSG_ERROR("You need Mozilla's NSS") 
     383  fi 
     384 
    377385  if test x$mozilla_xpcom = xno; then 
    378386   AC_MSG_ERROR("You need Mozilla's XPCOM") 
     
    383391  fi 
    384392 
    385   extraplatpkgs="$mozilla_xpcom $mozilla_gtkmozembed" 
     393  extraplatpkgs="$mozilla_nspr $mozilla_nss $mozilla_xpcom $mozilla_gtkmozembed" 
    386394  extratnypkgs="$extratnypkgs $extraplatpkgs" 
    387395  PKG_CHECK_MODULES(LIBTINYMAILUI_MOZEMBED, $extraplatpkgs glib-2.0 >= 2.8 gobject-2.0 gtk+-2.0 $extragtkpkgs) 
  • trunk/libtinymail-camel/camel-lite/config.h.in

    r1079 r2835  
    9595#undef HAVE_MKSTEMP 
    9696 
     97/* Define if we have mozilla api 1.8 */ 
     98#undef HAVE_MOZILLA_1_8 
     99 
     100/* Define if we have mozilla api 1.9 */ 
     101#undef HAVE_MOZILLA_1_9 
     102 
    97103/* Define if you have NSS */ 
    98104#undef HAVE_NSS 
     
    163169/* Define to 1 if you have the <unistd.h> header file. */ 
    164170#undef HAVE_UNISTD_H 
     171 
     172/* Detected mozilla engine version for mozembed */ 
     173#undef MOZEMBED_MOZILLA_VERSION 
    165174 
    166175/* Enable getaddrinfo emulation */ 
  • trunk/libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c

    r2825 r2835  
    4141                "PLAIN", 0, &list); 
    4242 
    43         if (keyringret != GNOME_KEYRING_RESULT_OK
     43        if ((keyringret != GNOME_KEYRING_RESULT_OK) || (list == NULL)
    4444        { 
    4545                gboolean canc = FALSE; 
  • trunk/libtinymailui-mozembed/Makefile.am

    r2829 r2835  
    2121        tny-moz-embed-html-mime-part-view.c \ 
    2222        tny-moz-embed-msg-view.c \ 
    23         tny-moz-embed-stream.c 
     23        tny-moz-embed-stream.c \ 
     24        mozilla-preferences.cpp \ 
     25        mozilla-preferences.h 
    2426 
    2527libtinymailui_mozembed_1_0_la_LIBADD =  \ 
  • trunk/libtinymailui-mozembed/tny-moz-embed-html-mime-part-view.c

    r2829 r2835  
    3232#include <gtk/gtk.h> 
    3333 
    34 #include <gtkmozembed_common.h> 
     34#include "mozilla-preferences.h" 
    3535 
    3636#include <tny-moz-embed-html-mime-part-view.h> 
     
    184184{ 
    185185        GObjectClass *object_class; 
    186         gint int_value; 
    187         gboolean bool_value; 
    188         const gchar *home_path; 
    189         const gchar *full_path; 
    190         const gchar *prgname; 
    191         gchar *profile_path; 
    192         gchar *useragent; 
    193186 
    194187        parent_class = g_type_class_peek_parent (class); 
     
    199192        g_type_class_add_private (object_class, sizeof (TnyMozEmbedHtmlMimePartViewPriv)); 
    200193 
    201         gtk_moz_embed_set_path (MOZILLA_HOME); 
    202  
    203         home_path = getenv ("HOME"); 
    204         if (!home_path) 
    205                 home_path = g_get_home_dir (); 
    206         prgname = g_get_prgname (); 
    207         if (!prgname) 
    208                 prgname = "tinymail"; 
    209         full_path = g_strdup_printf("%s/%s", home_path, ".tinymail"); 
    210         profile_path = g_strconcat ("mozembed-", prgname, NULL); 
    211         gtk_moz_embed_set_profile_path (full_path, profile_path); 
    212         g_free (profile_path); 
    213  
    214         gtk_moz_embed_push_startup (); 
    215  
    216         int_value = 2; 
    217         gtk_moz_embed_common_set_pref (GTK_TYPE_INT, "permissions.default.image", &int_value); 
    218         gtk_moz_embed_common_set_pref (GTK_TYPE_INT, "permissions.default.script", &int_value); 
    219  
    220         bool_value = FALSE; 
    221         gtk_moz_embed_common_set_pref (GTK_TYPE_BOOL, "security.checkloaduri", &bool_value); 
    222  
    223         useragent = g_strconcat (prgname, "/", VERSION, NULL); 
    224         gtk_moz_embed_common_set_pref (GTK_TYPE_STRING, "general.useragent.misc", useragent); 
    225         g_free (useragent); 
    226         gtk_moz_embed_common_set_pref (GTK_TYPE_STRING, "network.proxy.no_proxies_on", "localhost"); 
     194        _mozilla_preference_init (); 
    227195 
    228196        return; 
  • trunk/m4/moz.m4

    r2829 r2835  
    4949AC_MSG_RESULT($mozilla_gtkmozembed) 
    5050 
     51#Detect Mozilla XPCom version 
     52if test x$mozilla_xpcom != x; then 
     53 
     54   AC_MSG_CHECKING(Mozilla xpcom engine version) 
     55   #The only real way to detect the MOZILLA engine version is using the version in mozilla-config.h 
     56   #of the engine we use. 
     57   mozilla_xpcom_includedir="`$PKG_CONFIG --variable=includedir $mozilla_xpcom`" 
     58   mozilla_version=`cat $mozilla_xpcom_includedir/mozilla-config.h | grep MOZILLA_VERSION_U | sed "s/.*_VERSION_U\ //"|tr ".abpre+" " "` 
     59   mozilla_major_version=`echo $mozilla_version | awk ' { print $[1]; } '` 
     60   mozilla_minor_version=`echo $mozilla_version | awk ' { print $[2]; } '` 
     61 
     62   if test "$mozilla_major_version" != "1"; then 
     63      AC_DEFINE([HAVE_MOZILLA_1_9],[1],[Define if we have mozilla api 1.9]) 
     64      AC_DEFINE([HAVE_MOZILLA_1_8],[1],[Define if we have mozilla api 1.8]) 
     65   fi 
     66 
     67   if test "$mozilla_major_version" = "1" -a "$mozilla_minor_version" -ge "8"; then 
     68      AC_DEFINE([HAVE_MOZILLA_1_8],[1],[Define if we have mozilla api 1.8]) 
     69   fi 
     70       
     71   if test "$mozilla_major_version" = "1" -a "$mozilla_minor_version" -ge "9"; then 
     72      AC_DEFINE([HAVE_MOZILLA_1_9],[1],[Define if we have mozilla api 1.9]) 
     73   fi 
     74 
     75   AC_MSG_RESULT($mozilla_version) 
     76 
     77 
     78fi 
     79 
     80 
     81AM_CONDITIONAL([HAVE_MOZILLA_1_8],[test "mozilla_major_version" = "1" -a "$mozilla_minor_version" -ge "8"]) 
     82AM_CONDITIONAL([HAVE_MOZILLA_1_9],[test "$mozilla_major_version" = "1" -a "$mozilla_minor_version" -ge "9"]) 
     83AC_DEFINE([MOZEMBED_MOZILLA_VERSION],["$mozilla_version"],[Detected mozilla engine version for mozembed]) 
     84 
    5185]) 
    5286