From dc73c55eb1cfc2067b90971af02debb42d91c3fc Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Wed, 6 Jul 2005 18:22:55 +0000 Subject: [PATCH] 2005-07-06 [colin] 1.9.12cvs24 * configure.ac * src/account.c * src/folder.c * src/imap.c * src/etpan/etpan-log.c * src/etpan/etpan-thread-manager.c * src/etpan/imap-thread.c Add a --disable-libetpan parameter. With this, users that don't want IMAP4 support can avoid the new dependancy (and have no IMAP support). Users that have IMAP4 accounts and use this parameter won't lose their configuration, their IMAP accounts will just be invisible and not used. * src/textview.c Make the "Copy ..." contextual menu items copy to both the X clipboard and the gtk clipboard - as most other apps do. * src/gtk/about.c Add a notice about OpenSSL usage, in order to comply with OpenSSL's license (point 6): http://www.openssl.org/source/license.html --- ChangeLog-gtk2.claws | 25 ++++++++++++++ PATCHSETS | 1 + configure.ac | 59 ++++++++++++++++++-------------- src/account.c | 8 +++-- src/etpan/etpan-log.c | 7 ++++ src/etpan/etpan-thread-manager.c | 7 ++++ src/etpan/imap-thread.c | 19 ++++++++++ src/folder.c | 7 +++- src/gtk/about.c | 6 +++- src/imap.c | 51 +++++++++++++++++++++++++-- src/textview.c | 6 ++-- 11 files changed, 162 insertions(+), 34 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index d5539a076..e28251a68 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,28 @@ +2005-07-06 [colin] 1.9.12cvs24 + + * configure.ac + * src/account.c + * src/folder.c + * src/imap.c + * src/etpan/etpan-log.c + * src/etpan/etpan-thread-manager.c + * src/etpan/imap-thread.c + Add a --disable-libetpan parameter. With this, + users that don't want IMAP4 support can avoid + the new dependancy (and have no IMAP support). + Users that have IMAP4 accounts and use this + parameter won't lose their configuration, their + IMAP accounts will just be invisible and not + used. + * src/textview.c + Make the "Copy ..." contextual menu items + copy to both the X clipboard and the gtk + clipboard - as most other apps do. + * src/gtk/about.c + Add a notice about OpenSSL usage, in order to + comply with OpenSSL's license (point 6): + http://www.openssl.org/source/license.html + 2005-07-06 [colin] 1.9.12cvs23 * src/alertpanel.c diff --git a/PATCHSETS b/PATCHSETS index e1249cd4d..043c729fa 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -618,3 +618,4 @@ ( cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/plugins/trayicon/libeggtrayicon/eggtrayicon.c; ) > 1.9.12cvs21.patchset ( cvs diff -u -r 1.179.2.46 -r 1.179.2.47 src/imap.c; ) > 1.9.12cvs22.patchset ( cvs diff -u -r 1.17.2.15 -r 1.17.2.16 src/alertpanel.c; cvs diff -u -r 1.382.2.140 -r 1.382.2.141 src/compose.c; cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/imap_gtk.c; cvs diff -u -r 1.2.2.7 -r 1.2.2.8 src/mh_gtk.c; ) > 1.9.12cvs23.patchset +( cvs diff -u -r 1.654.2.658 -r 1.654.2.659 configure.ac; cvs diff -u -r 1.61.2.27 -r 1.61.2.28 src/account.c; cvs diff -u -r 1.213.2.39 -r 1.213.2.40 src/folder.c; cvs diff -u -r 1.179.2.47 -r 1.179.2.48 src/imap.c; cvs diff -u -r 1.96.2.59 -r 1.96.2.60 src/textview.c; cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/etpan/etpan-log.c; cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/etpan/etpan-thread-manager.c; cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/etpan/imap-thread.c; cvs diff -u -r 1.4.2.12 -r 1.4.2.13 src/gtk/about.c; ) > 1.9.12cvs24.patchset diff --git a/configure.ac b/configure.ac index 341f823fa..48f66200e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=12 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=23 +EXTRA_VERSION=24 EXTRA_RELEASE= EXTRA_GTK2_VERSION= @@ -614,32 +614,38 @@ AC_SUBST(CLAMAV_LIBS) AM_CONDITIONAL(BUILD_CLAMAV_PLUGIN, test x"$ac_cv_enable_clamav_plugin" = xyes) dnl Libetpan -libetpan=no -AC_PATH_PROG(libetpanconfig, [libetpan-config]) -if test "x$libetpanconfig" != "x"; then - CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`" - AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan=yes]) - if test "x$libetpan" = "xyes"; then - AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine]) - LDFLAGS="$LDFLAGS `$libetpanconfig --libs 2>/dev/null`" - AC_TRY_LINK([], [db_mailstorage_init();], [libetpan=yes], [libetpan=no]) - AC_MSG_RESULT([$libetpan]) - fi -fi -if test "x$libetpan" = "xyes"; then - LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`" - LIBETPAN_LIBS="`$libetpanconfig --libs`" - LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"` - if test "$LIBETPAN_VERSION" -lt "037"; then - AC_MSG_ERROR([Sylpheed requires libetpan 0.37 or newer. See http://www.etpan.org/]) - fi -else - AC_MSG_ERROR([Sylpheed requires libetpan 0.37 or newer. See http://www.etpan.org/ ]) +AC_ARG_ENABLE(libetpan, + [ --disable-libetpan Do not compile IMAP4 support with libetpan], + [ac_cv_enable_libetpan=$enableval], [ac_cv_enable_libetpan=yes]) +if test x"$ac_cv_enable_libetpan" = xyes; then + libetpan_result=no + AC_PATH_PROG(libetpanconfig, [libetpan-config]) + if test "x$libetpanconfig" != "x"; then + CPPFLAGS="$CPPFLAGS `$libetpanconfig --cflags 2>/dev/null`" + AC_CHECK_HEADER(libetpan/libetpan.h, [libetpan_result=yes]) + if test "x$libetpan_result" = "xyes"; then + AC_MSG_CHECKING([whether libetpan-config hints compiles and links fine]) + LDFLAGS="$LDFLAGS `$libetpanconfig --libs 2>/dev/null`" + AC_TRY_LINK([], [db_mailstorage_init();], [libetpan_result=yes], [libetpan_result=no]) + AC_MSG_RESULT([$libetpan_result]) + fi + fi + if test "x$libetpan_result" = "xyes"; then + LIBETPAN_CPPFLAGS="`$libetpanconfig --cflags`" + LIBETPAN_LIBS="`$libetpanconfig --libs`" + LIBETPAN_VERSION=`$libetpanconfig --version | sed "s/\.//g" | sed "s/-.*$//"` + if test "$LIBETPAN_VERSION" -lt "037"; then + AC_MSG_ERROR([Sylpheed requires libetpan 0.37 or newer. See http://www.etpan.org/]) + AC_MSG_ERROR([You can use --disable-libetpan if you don't need IMAP4 support.]) + fi + AC_SUBST(LIBETPAN_FLAGS) + AC_SUBST(LIBETPAN_LIBS) + AC_DEFINE(HAVE_LIBETPAN, 1, Define if you want IMAP support.) + else + AC_MSG_ERROR([Sylpheed requires libetpan 0.37 or newer. See http://www.etpan.org/ ]) + AC_MSG_ERROR([You can use --disable-libetpan if you don't need IMAP4 support.]) + fi fi - -AC_SUBST(LIBETPAN_FLAGS) -AC_SUBST(LIBETPAN_LIBS) - dnl **************************** dnl ** Final configure output ** dnl **************************** @@ -694,6 +700,7 @@ echo "iconv : $am_cv_func_iconv" echo "compface : $ac_cv_enable_compface" echo "IPv6 : $ac_cv_enable_ipv6" echo "GNU/aspell : $ac_cv_enable_aspell" +echo "IMAP4 : $ac_cv_enable_libetpan" echo "Crash dialog : $ac_cv_enable_crash_dialog" echo "Plugins : $PLUGINS" echo "Config dir : $ac_cv_with_config_dir" diff --git a/src/account.c b/src/account.c index fd6e73367..566fde425 100644 --- a/src/account.c +++ b/src/account.c @@ -412,7 +412,10 @@ void account_add(void) folder = folder_new(folder_get_class_from_string("news"), ac_prefs->account_name, ac_prefs->nntp_server); } - + if (folder == NULL) { + alertpanel_error(_("Can't create folder.")); + return; + } folder->account = ac_prefs; ac_prefs->folder = folder; folder_add(folder); @@ -495,7 +498,8 @@ void account_set_missing_folder(void) folder = folder_new(folder_get_class_from_string("news"), ap->account_name, ap->nntp_server); } - + if (folder == NULL) + return; folder->account = ap; ap->folder = folder; folder_add(folder); diff --git a/src/etpan/etpan-log.c b/src/etpan/etpan-log.c index 5d4598175..83d4547ee 100644 --- a/src/etpan/etpan-log.c +++ b/src/etpan/etpan-log.c @@ -1,3 +1,9 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_LIBETPAN + #include "etpan-log.h" #include @@ -185,3 +191,4 @@ void etpan_log_stack(void) #endif #endif +#endif diff --git a/src/etpan/etpan-thread-manager.c b/src/etpan/etpan-thread-manager.c index c530e0a1d..37a1daaab 100644 --- a/src/etpan/etpan-thread-manager.c +++ b/src/etpan/etpan-thread-manager.c @@ -1,3 +1,9 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_LIBETPAN + #include "etpan-thread-manager.h" #include @@ -631,3 +637,4 @@ void etpan_thread_manager_join(struct etpan_thread_manager * manager) etpan_thread_manager_loop(manager); } } +#endif diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c index 45ae45e00..b7d00265b 100644 --- a/src/etpan/imap-thread.c +++ b/src/etpan/imap-thread.c @@ -1,3 +1,9 @@ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_LIBETPAN + #include "imap-thread.h" #include @@ -2167,3 +2173,16 @@ int imap_threaded_connect_cmd(Folder * folder, const char * command, return result.error; } +#else + +void imap_main_init(void) +{ +} +void imap_main_done(void) +{ +} +void imap_main_set_timeout(int sec) +{ +} + +#endif diff --git a/src/folder.c b/src/folder.c index 2ed20e153..97ef715c4 100644 --- a/src/folder.c +++ b/src/folder.c @@ -156,6 +156,9 @@ Folder *folder_new(FolderClass *klass, const gchar *name, const gchar *path) /* Create root folder item */ item = folder_item_new(folder, name, NULL); + if (item == NULL) { + return NULL; + } item->folder = folder; folder->node = item->node = g_node_new(item); folder->data = NULL; @@ -257,7 +260,9 @@ XMLTag *folder_get_xml(Folder *folder) FolderItem *folder_item_new(Folder *folder, const gchar *name, const gchar *path) { FolderItem *item = NULL; - + + g_return_val_if_fail(folder != NULL, NULL); + if (folder->klass->item_new) { item = folder->klass->item_new(folder); } else { diff --git a/src/gtk/about.c b/src/gtk/about.c index d6a238b5e..40ff23c0e 100644 --- a/src/gtk/about.c +++ b/src/gtk/about.c @@ -239,7 +239,11 @@ static void about_create(void) "along with this program; if not, write to the Free Software " "Foundation, Inc., 59 Temple Place - Suite 330, Boston, " "MA 02111-1307, USA."), -1); - +#ifdef USE_OPENSSL + gtk_text_buffer_insert(buffer, &iter, + _("\n\nThis product includes software developed by the OpenSSL Project " + "for use in the OpenSSL Toolkit (http://www.openssl.org/)"), -1); +#endif gtkut_stock_button_set_create(&confirm_area, &close_button, GTK_STOCK_CLOSE, NULL, NULL, NULL, NULL); gtk_box_pack_end(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 4); diff --git a/src/imap.c b/src/imap.c index 753edb30a..54a185b40 100644 --- a/src/imap.c +++ b/src/imap.c @@ -27,6 +27,11 @@ #include #include #include +#include "imap.h" +#include "imap_gtk.h" + +#ifdef HAVE_LIBETPAN + #include #include #include @@ -44,8 +49,6 @@ #include "folder.h" #include "session.h" #include "procmsg.h" -#include "imap.h" -#include "imap_gtk.h" #include "socket.h" #include "recv.h" #include "procheader.h" @@ -3752,3 +3755,47 @@ static struct mailimap_flag_list * imap_flag_to_lep(IMAPFlags flags) return flag_list; } +#else /* HAVE_LIBETPAN */ + +static FolderClass imap_class; + +static Folder *imap_folder_new (const gchar *name, + const gchar *path) +{ + return NULL; +} +static gint imap_create_tree (Folder *folder) +{ + return -1; +} +static FolderItem *imap_create_folder (Folder *folder, + FolderItem *parent, + const gchar *name) +{ + return NULL; +} +static gint imap_rename_folder (Folder *folder, + FolderItem *item, + const gchar *name) +{ + return -1; +} + +FolderClass *imap_get_class(void) +{ + if (imap_class.idstr == NULL) { + imap_class.type = F_IMAP; + imap_class.idstr = "imap"; + imap_class.uistr = "IMAP4"; + + imap_class.new_folder = imap_folder_new; + imap_class.create_tree = imap_create_tree; + imap_class.create_folder = imap_create_folder; + imap_class.rename_folder = imap_rename_folder; + /* nothing implemented */ + } + + return &imap_class; +} + +#endif diff --git a/src/textview.c b/src/textview.c index 1997e4a2c..2756dad49 100644 --- a/src/textview.c +++ b/src/textview.c @@ -2323,7 +2323,8 @@ static void copy_uri_cb (TextView *textview, guint action, void *data) if (uri == NULL) return; - gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), uri->uri, -1); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), uri->uri, -1); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), uri->uri, -1); g_object_set_data(G_OBJECT(textview->link_popup_menu), "menu_button", NULL); } @@ -2375,7 +2376,8 @@ static void copy_mail_to_uri_cb (TextView *textview, guint action, void *data) if (uri == NULL) return; - gtk_clipboard_set_text(gtk_clipboard_get(GDK_NONE), uri->uri + 7, -1); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_PRIMARY), uri->uri +7, -1); + gtk_clipboard_set_text(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), uri->uri +7, -1); g_object_set_data(G_OBJECT(textview->mail_popup_menu), "menu_button", NULL); } -- 2.25.1