* src/addr_compl.c
* src/addr_compl.h
Add a hook to make it possible for plugins to
modify the address completion list
+2009-05-10 [holger] 3.7.1cvs53
+
+ * src/addr_compl.c
+ * src/addr_compl.h
+ Add a hook to make it possible for plugins to
+ modify the address completion list
+
2009-05-06 [paul] 3.7.1cvs52
* src/folder.c
2009-05-06 [paul] 3.7.1cvs52
* src/folder.c
( cvs diff -u -r 1.36.2.169 -r 1.36.2.170 src/common/utils.c; ) > 3.7.1cvs50.patchset
( cvs diff -u -r 1.36.2.170 -r 1.36.2.171 src/common/utils.c; ) > 3.7.1cvs51.patchset
( cvs diff -u -r 1.213.2.193 -r 1.213.2.194 src/folder.c; cvs diff -u -r 1.83.2.154 -r 1.83.2.155 src/mimeview.c; ) > 3.7.1cvs52.patchset
( cvs diff -u -r 1.36.2.169 -r 1.36.2.170 src/common/utils.c; ) > 3.7.1cvs50.patchset
( cvs diff -u -r 1.36.2.170 -r 1.36.2.171 src/common/utils.c; ) > 3.7.1cvs51.patchset
( cvs diff -u -r 1.213.2.193 -r 1.213.2.194 src/folder.c; cvs diff -u -r 1.83.2.154 -r 1.83.2.155 src/mimeview.c; ) > 3.7.1cvs52.patchset
+( cvs diff -u -r 1.27.2.45 -r 1.27.2.46 src/addr_compl.c; cvs diff -u -r 1.8.2.12 -r 1.8.2.13 src/addr_compl.h; ) > 3.7.1cvs53.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
#include "utils.h"
#include "prefs_common.h"
#include "claws.h"
#include "utils.h"
#include "prefs_common.h"
#include "claws.h"
* addresses a little more (e.g. break up alfons@proteus.demon.nl into
* something like alfons, proteus, demon, nl; and then completing on
* any of those words).
* addresses a little more (e.g. break up alfons@proteus.demon.nl into
* something like alfons, proteus, demon, nl; and then completing on
* any of those words).
- */
-
-/**
- * address_entry - structure which refers to the original address entry in the
- * address book .
-typedef struct
-{
- gchar *name;
- gchar *address;
- GList *grp_emails;
-} address_entry;
/**
* completion_entry - structure used to complete addresses, with a reference
/**
* completion_entry - structure used to complete addresses, with a reference
* \param str Index string value.
* \param ae Entry containing address data.
*/
* \param str Index string value.
* \param ae Entry containing address data.
*/
-static void add_address1(const char *str, address_entry *ae)
+void addr_compl_add_address1(const char *str, address_entry *ae)
{
completion_entry *ce1;
ce1 = g_new0(completion_entry, 1),
{
completion_entry *ce1;
ce1 = g_new0(completion_entry, 1),
cm_return_val_if_fail(ae != NULL, -1);
ae->name = g_strdup(name);
cm_return_val_if_fail(ae != NULL, -1);
ae->name = g_strdup(name);
- ae->address = g_strdup(address);
+ ae->address = g_strdup(address);
ae->grp_emails = grp_emails;
g_address_list = g_list_prepend(g_address_list, ae);
ae->grp_emails = grp_emails;
g_address_list = g_list_prepend(g_address_list, ae);
- add_address1(name, ae);
+ addr_compl_add_address1(name, ae);
if (address != NULL && *address != '\0')
if (address != NULL && *address != '\0')
- add_address1(address, ae);
-
+ addr_compl_add_address1(address, ae);
+
if (nick != NULL && *nick != '\0')
if (nick != NULL && *nick != '\0')
- add_address1(nick, ae);
-
+ addr_compl_add_address1(nick, ae);
+
if ( alias != NULL && *alias != '\0') {
if ( alias != NULL && *alias != '\0') {
- add_address1(alias, ae);
+ addr_compl_add_address1(alias, ae);
free_completion_list();
addrindex_load_completion( add_address, folderpath );
free_completion_list();
addrindex_load_completion( add_address, folderpath );
+
+ /* plugins may hook in here to modify/extend the completion list */
+ hooks_invoke(ADDDRESS_COMPLETION_BUILD_ADDRESS_LIST_HOOKLIST, &g_address_list);
+
g_address_list = g_list_reverse(g_address_list);
g_completion_list = g_list_reverse(g_completion_list);
/* merge the completion entry list into g_completion */
if (g_completion_list) {
g_completion_add_items(g_completion, g_completion_list);
if (debug_get_mode())
g_address_list = g_list_reverse(g_address_list);
g_completion_list = g_list_reverse(g_completion_list);
/* merge the completion entry list into g_completion */
if (g_completion_list) {
g_completion_add_items(g_completion, g_completion_list);
if (debug_get_mode())
- debug_print("read %d items in %s\n",
+ debug_print("read %d items in %s\n",
g_list_length(g_completion_list),
folderpath?folderpath:"(null)");
}
g_list_length(g_completion_list),
folderpath?folderpath:"(null)");
}
* not using a time out would result in a crash. if this doesn't work
* safely, maybe we should set variables when receiving button presses
* in the tree view. */
* not using a time out would result in a crash. if this doesn't work
* safely, maybe we should set variables when receiving button presses
* in the tree view. */
- if (!window->destroying) {
- window->destroying = TRUE;
+ if (!window->destroying) {
+ window->destroying = TRUE;
g_idle_add((GSourceFunc) addr_compl_defer_select_destruct, data);
g_idle_add((GSourceFunc) addr_compl_defer_select_destruct, data);
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __ADDR_COMPL_H__
#define __ADDR_COMPL_H__
#include <gtk/gtk.h>
#ifndef __ADDR_COMPL_H__
#define __ADDR_COMPL_H__
#include <gtk/gtk.h>
+#define ADDDRESS_COMPLETION_BUILD_ADDRESS_LIST_HOOKLIST "address_completion_build_address_list_hooklist"
+
+/**
+ * address_entry - structure which refers to the original address entry in the
+ * address book .
+ */
+typedef struct
+{
+ gchar *name;
+ gchar *address;
+ GList *grp_emails;
+} address_entry;
+
gint start_address_completion (gchar *folderpath);
guint complete_address (const gchar *str);
guint complete_matches_found (const gchar *str);
gint start_address_completion (gchar *folderpath);
guint complete_address (const gchar *str);
guint complete_matches_found (const gchar *str);
void addrcompl_initialize ( void );
void addrcompl_teardown ( void );
void addrcompl_initialize ( void );
void addrcompl_teardown ( void );
+void addr_compl_add_address1(const char *str, address_entry *ae);
+
#endif /* __ADDR_COMPL_H__ */
#endif /* __ADDR_COMPL_H__ */