From 8f85c055ba6150c669d8dd598aff00f5d2daa739 Mon Sep 17 00:00:00 2001 From: Paul Mangan Date: Thu, 20 Jan 2005 06:27:10 +0000 Subject: [PATCH] 2005-01-20 [paul] 1.0.0cvs3.1 * ChangeLog.claws * configure.ac * src/addrindex.c * src/addrindex.h sync with HEAD --- ChangeLog-gtk2.claws | 8 +++++ ChangeLog.claws | 48 ++++++++++++++++++++++++++ PATCHSETS | 1 + configure.ac | 4 +-- src/addrindex.c | 82 ++++++++++++++++++++++++++++++++++++++++++-- src/addrindex.h | 4 +++ 6 files changed, 143 insertions(+), 4 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index d843d97e7..8e26ea2fb 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,11 @@ +2005-01-20 [paul] 1.0.0cvs3.1 + + * ChangeLog.claws + * configure.ac + * src/addrindex.c + * src/addrindex.h + sync with HEAD + 2005-01-19 [colin] 1.0.0cvs2.2 * src/plugins/trayicon/trayicon.c diff --git a/ChangeLog.claws b/ChangeLog.claws index 6421cbf9a..71046275a 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,51 @@ +2005-01-20 [holger] 1.0.0cvs3 + + * src/addrindex.c + * src/addrindex.h + Add addrindex_load_person_attribute() (for plugins) + +2005-01-19 [colin] 1.0.0cvs2 + + * src/mbox.c + * src/mbox.h + * src/mainwindow.c + * src/summaryview.c + * src/summaryview.h + Add an easy way to export specific messages + to an mbox file. + +2005-01-19 [paul] 1.0.0cvs1 + + * po/ja.po + * po/ko.po + updated by Rui Hirokawa and + SungHyun Nam + +2005-01-18 [paul] 1.0.0 + + * version 1.0.0 released + +2005-01-17 [thorsten] 0.9.13cvs38 + + * src/crash.c + * src/gtk/pluginwindow.c + return value of filesel should not be free()d + +2005-01-17 [paul] 0.9.13cvs37 + + * AUTHORS + * po/es.po + * po/fr.po + * po/hr.po + * po/it.po + * po/pt_BR.po + * po/sk.po + * po/sr.po + update translations. submitted by Ricardo Mones + Lastra, Fabien Vantard, Dragan, Andrea Spadaccini, + Frederico Goncalves Guimaraes, Andrej Kacian, + Aleksandar Urosevic + 2005-01-16 [colin] 0.9.13cvs36 * src/prefs_toolbar.c diff --git a/PATCHSETS b/PATCHSETS index 7ee5614dd..f0d236cd1 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -328,3 +328,4 @@ ( cvs diff -u -r 1.654.2.360 -r 1.654.2.361 configure.ac; cvs diff -u -r 1.58.2.5 -r 1.58.2.6 po/de.po; cvs diff -u -r 1.60.2.6 -r 1.60.2.7 po/es.po; cvs diff -u -r 1.42.2.6 -r 1.42.2.7 po/fr.po; cvs diff -u -r 1.7.2.3 -r 1.7.2.4 po/hr.po; cvs diff -u -r 1.34.2.5 -r 1.34.2.6 po/it.po; cvs diff -u -r 1.16.2.4 -r 1.16.2.5 po/ja.po; cvs diff -u -r 1.8.2.2 -r 1.8.2.3 po/ko.po; cvs diff -u -r 1.50.2.4 -r 1.50.2.5 po/pt_BR.po; cvs diff -u -r 1.17.2.3 -r 1.17.2.4 po/ru.po; cvs diff -u -r 1.2.2.7 -r 1.2.2.8 po/sk.po; cvs diff -u -r 1.17.2.7 -r 1.17.2.8 po/sr.po; ) > 1.0.0cvs1.1.patchset ( cvs diff -u -r 1.274.2.26 -r 1.274.2.27 src/mainwindow.c; cvs diff -u -r 1.28.2.2 -r 1.28.2.3 src/mbox.c; cvs diff -u -r 1.3.2.2 -r 1.3.2.3 src/mbox.h; cvs diff -u -r 1.395.2.41 -r 1.395.2.42 src/summaryview.c; cvs diff -u -r 1.68.2.4 -r 1.68.2.5 src/summaryview.h; ) > 1.0.0cvs2.1.patchset ( cvs diff -u -r 1.14.2.13 -r 1.14.2.14 src/plugins/trayicon/trayicon.c; ) > 1.0.0cvs2.2.patchset +( cvs diff -u -r 1.2504.2.43 -r 1.2504.2.44 ChangeLog.claws; cvs diff -u -r 1.654.2.363 -r 1.654.2.364 configure.ac; cvs diff -u -r 1.28.2.3 -r 1.28.2.4 src/addrindex.c; cvs diff -u -r 1.9.2.3 -r 1.9.2.4 src/addrindex.h; ) > 1.0.0cvs3.1.patchset diff --git a/configure.ac b/configure.ac index 3ec0ae063..d9a4797d9 100644 --- a/configure.ac +++ b/configure.ac @@ -11,9 +11,9 @@ MINOR_VERSION=0 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=2 +EXTRA_VERSION=3 EXTRA_RELEASE= -EXTRA_GTK2_VERSION=.2 +EXTRA_GTK2_VERSION=.1 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION} diff --git a/src/addrindex.c b/src/addrindex.c index 3e1bb49d2..3f26fb6da 100644 --- a/src/addrindex.c +++ b/src/addrindex.c @@ -2875,8 +2875,86 @@ gboolean addrindex_load_completion( return TRUE; } -/* - * End of Source. +/** + * This function can be used to collect information about + * addressbook entries that contain a specific attribute. + * + * \param attr Name of attribute to look for + * \param callBackFunc Function to be called when a matching attribute was found + * \return TRUE */ +gboolean addrindex_load_person_attribute( + const gchar *attr, + gint (*callBackFunc) ( ItemPerson *, const gchar * ) ) +{ + AddressDataSource *ds; + GList *nodeIf, *nodeDS; + GList *listP, *nodeP; + GList *nodeA; + + nodeIf = addrindex_get_interface_list( _addressIndex_ ); + while( nodeIf ) { + gchar *cur_bname; + AddressInterface *iface = nodeIf->data; + + nodeIf = g_list_next( nodeIf ); + if( ! iface->useInterface ) { + continue; + } + if( iface->externalQuery ) { + continue; + } + nodeDS = iface->listSource; + while( nodeDS ) { + ds = nodeDS->data; + + /* Read address book */ + if( addrindex_ds_get_modify_flag( ds ) ) { + addrindex_ds_read_data( ds ); + } + + if( ! addrindex_ds_get_read_flag( ds ) ) { + addrindex_ds_read_data( ds ); + } + /* Check addressbook name */ + cur_bname = addrindex_ds_get_name( ds ); + /* Get all persons */ + listP = addrindex_ds_get_all_persons( ds ); + nodeP = listP; + while( nodeP ) { + ItemPerson *person = nodeP->data; + + /* Return all ItemPerson's if attr is NULL */ + if( attr == NULL ) { + callBackFunc(person, cur_bname); + } + + /* Return ItemPerson's with specific attribute */ + else { + nodeA = person->listAttrib; + /* Process each User Attribute */ + while( nodeA ) { + UserAttribute *attrib = nodeA->data; + if( attrib->name && + !strcmp( attrib->name,attr ) ) { + callBackFunc(person, cur_bname); + } + nodeA = g_list_next( nodeA ); + } + } + nodeP = g_list_next( nodeP ); + } + /* Free up the list */ + g_list_free( listP ); + + nodeDS = g_list_next( nodeDS ); + } + } + return TRUE; +} + +/* + * End of Source. + */ diff --git a/src/addrindex.h b/src/addrindex.h index 4dc69ba3f..0c940b639 100644 --- a/src/addrindex.h +++ b/src/addrindex.h @@ -183,6 +183,10 @@ gboolean addrindex_load_completion( ( const gchar *, const gchar *, const gchar *, const gchar * ) ); +gboolean addrindex_load_person_attribute( const gchar *attr, + gint (*callBackFunc) + ( ItemPerson *, const gchar * ) ); + #endif /* __ADDRINDEX_H__ */ /* -- 2.25.1