2007-06-02 [colin] 2.9.2cvs27
authorColin Leroy <colin@colino.net>
Sat, 2 Jun 2007 17:59:55 +0000 (17:59 +0000)
committerColin Leroy <colin@colino.net>
Sat, 2 Jun 2007 17:59:55 +0000 (17:59 +0000)
* src/addressbook.c
Fix possible crash, fix ldap write bugs
* src/ldapupdate.c
Fix ldap write bugs - patch by Michael
Rasmussen
* src/alertpanel.c
* src/alertpanel.h
Add a hook whenever alertpanel opens/closes

ChangeLog
PATCHSETS
configure.ac
src/addressbook.c
src/alertpanel.c
src/alertpanel.h
src/ldapupdate.c

index 8ce10f737381e397c24e9209f675c24700720a62..47cfe54e76a97f10cb68da046385d22bd2058521 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-06-02 [colin]     2.9.2cvs27
+
+       * src/addressbook.c
+               Fix possible crash, fix ldap write bugs
+       * src/ldapupdate.c
+               Fix ldap write bugs - patch by Michael
+               Rasmussen
+       * src/alertpanel.c
+       * src/alertpanel.h
+               Add a hook whenever alertpanel opens/closes
+
 2007-05-31 [wwp]       2.9.2cvs26
 
        * src/prefs_compose_writing.c
index 6229d7ae438f09e6d02da50616d158d62d3dea0c..03a8036a1e315a6c8cbceb63da2bf7167af64608 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.88 -r 1.60.2.89 src/addressbook.c;  ) > 2.9.2cvs24.patchset
 ( cvs diff -u -r 1.382.2.382 -r 1.382.2.383 src/compose.c;  ) > 2.9.2cvs25.patchset
 ( cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_compose_writing.c;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/prefs_quote.c;  ) > 2.9.2cvs26.patchset
+( cvs diff -u -r 1.60.2.89 -r 1.60.2.90 src/addressbook.c;  cvs diff -u -r 1.17.2.33 -r 1.17.2.34 src/alertpanel.c;  cvs diff -u -r 1.5.2.11 -r 1.5.2.12 src/alertpanel.h;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/ldapupdate.c;  ) > 2.9.2cvs27.patchset
index 385dd3273d83dee29b8312f9f034de7d7836047c..672e76ea8ae1195573a7dbe4b63edb51a2a7344d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=26
+EXTRA_VERSION=27
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b563ae2d4a917380a4199dc668f5db6477e2ca29..8a1267a5b5d1ddfbc0c6931da336d4dc8b9ac941 100644 (file)
@@ -3048,6 +3048,7 @@ static void addressbook_new_address_cb( gpointer data, guint action, GtkWidget *
                                        alertpanel( _("Add address(es)"),
                                                addressbook_err2string(_lutErrorsLDAP_, server->retVal),
                                                GTK_STOCK_CLOSE, NULL, NULL );
+                                       server->retVal = LDAPRC_SUCCESS;
                                        return;
                                }
                        }
@@ -3425,7 +3426,8 @@ static void addressbook_folder_load_one_person(
                                text[COL_NAME] = str;
                        }
 #ifdef USE_LDAP
-                       else if( abf->type == ADDR_IF_LDAP && person->nickName ) {
+                       else if( abf && abf->type == ADDR_IF_LDAP && 
+                                person && person->nickName ) {
                                if (person->nickName) {
                                        if (strcmp(person->nickName, "") != 0) {
                                                text[COL_NAME] = person->nickName;
index 202dc975f80ca86aca7476319aebc95612b0cf04..b09676b01a7da38dbbee7ef85656b7053d453900 100644 (file)
@@ -41,9 +41,8 @@
 #define TITLE_HEIGHT           72
 #define MESSAGE_HEIGHT         62
 
-gboolean alertpanel_is_open = FALSE;
 static AlertValue value;
-
+static gboolean alertpanel_is_open = FALSE;
 static GtkWidget *dialog;
 
 static void alertpanel_show            (void);
@@ -94,9 +93,10 @@ AlertValue alertpanel_full(const gchar *title, const gchar *message,
 {
        if (alertpanel_is_open)
                return -1;
-       else
+       else {
                alertpanel_is_open = TRUE;
-       
+               hooks_invoke(ALERTPANEL_OPENED_HOOKLIST, &alertpanel_is_open);
+       }
        alertpanel_create(title, message, button1_label, button2_label,
                          button3_label, can_disable, widget, alert_type,
                          default_value);
@@ -121,8 +121,10 @@ static void alertpanel_message(const gchar *title, const gchar *message, gint ty
 {
        if (alertpanel_is_open)
                return;
-       else
+       else {
                alertpanel_is_open = TRUE;
+               hooks_invoke(ALERTPANEL_OPENED_HOOKLIST, &alertpanel_is_open);
+       }
 
        alertpanel_create(title, message, GTK_STOCK_CLOSE, NULL, NULL,
                          FALSE, NULL, type, G_ALERTDEFAULT);
@@ -213,6 +215,8 @@ static void alertpanel_show(void)
        GTK_EVENTS_FLUSH();
 
        alertpanel_is_open = FALSE;
+       hooks_invoke(ALERTPANEL_OPENED_HOOKLIST, &alertpanel_is_open);
+
        inc_unlock();
 }
 
index d2201757934d2fa96689b3316897fb70ab5ff56f..9a2f81b7ac779e3fa6f67710974dd137479e8f14 100644 (file)
@@ -42,6 +42,8 @@ typedef enum
 } AlertType;
 #define G_ALERT_VALUE_MASK     0x0000ffff
 
+#define ALERTPANEL_OPENED_HOOKLIST "alertpanel_opened_hooklist"
+
 AlertValue alertpanel_full(const gchar *title, const gchar *message,
                           const gchar *button1_label,
                           const gchar *button2_label,
index 15a9d2e4934e6385d1bd9706590a988b6f5a0c8c..b10c8e3a4a96d3ba8b6f93a7beb401f9ec232481 100644 (file)
  * Outstanding bugs
  * 1) When adding a contact to an empty addressbook from the pop-up menu
  * when right-clicking on an email address causes claws-mail to crash in
- * addritem.c line 965. Severity: Show stopper.
+ * addritem.c line 965. Severity: Show stopper. Solved in 2.9.2cvs17
  * 2) Updating a contact gets lost if the user makes a new search on the
- * same LdapServer. Severity: Medium.
+ * same LdapServer. Severity: Medium. Solved in 2.9.2cvs17 (patch added to solve 1) also solved this bug)
  * 3) After adding a new contact the displayName for the contact is empty
  * until the user makes a reread from the LdapServer. Severity: minor.
+ * Solved in 2.9.2cvs24
  */
 
 #ifdef HAVE_CONFIG_H
@@ -500,6 +501,16 @@ void clean_up(LDAP *ld, LdapServer *server, GHashTable *contact) {
                if (displayName)
                        person->nickName = g_strdup(displayName);
        }
+       if (server->retVal != LDAPRC_SUCCESS) {
+               if (person) {
+                       ItemPerson *res = 
+                               addrcache_remove_person(server->addressCache, person);
+                       if (!res)
+                               g_critical(N_("ldapsvr_update_book: Could not clean cache\n"));
+                       else
+                               addritem_free_item_person(res);
+               }
+       }
        if (ld)
                ldapsvr_disconnect(ld);
 /*     ldapsvr_force_refresh(server);
@@ -652,6 +663,7 @@ void ldapsvr_add_contact(LdapServer *server, GHashTable *contact) {
        }
        if (email == NULL) {
                server->retVal = LDAPRC_NODN;
+               clean_up(ld, server, contact);
                return;
        }
        base_dn = g_strdup_printf("mail=%s,%s", email, server->control->baseDN);
@@ -834,6 +846,7 @@ void ldapsvr_update_contact(LdapServer *server, GHashTable *contact) {
                                fprintf(stderr, "new dn: %s\n", newRdn);
                                fprintf(stderr, "LDAP Error(ldap_modrdn2_s) failed[0x%x]: %s\n", rc, ldap_err2string(rc));
                                g_free(newRdn);
+                               clean_up(ld, server, contact);
                                return;
                        }
                }
@@ -967,6 +980,7 @@ void ldapsvr_delete_contact(LdapServer *server, GHashTable *contact) {
                clean_up(ld, server, contact);
                return;
        }
+       server->retVal = LDAPRC_SUCCESS;
        rc = ldap_delete_ext_s(ld, dn, NULL, NULL);
        if (rc) {
                fprintf(stderr, "ldap_modify for dn=%s\" failed[0x%x]: %s\n",