#include "addrselect.h"
#include "addrclip.h"
+#include "addrgather.h"
typedef enum
{
* to be loaded.
* Return: TRUE if data loaded, FALSE if address index not loaded.
*/
-gboolean addressbook_load_completion( gint (*callBackFunc) ( const gchar *, const gchar * ) ) {
+gboolean addressbook_load_completion( gint (*callBackFunc) ( const gchar *, const gchar *, const gchar * ) ) {
AddressDataSource *ds;
GList *nodeIf, *nodeDS;
GList *listP, *nodeP;
if( sAlias && *sAlias != '\0' ) {
sFriendly = sAlias;
}
- ( callBackFunc ) ( sFriendly, sAddress );
+ ( callBackFunc ) ( sFriendly, sAddress, sName );
}
nodeM = g_list_next( nodeM );
}
}
+/*
+* Gather addresses.
+* Enter: folderItem Folder to import.
+*/
+void addressbook_gather( FolderItem *folderItem ) {
+ AddressDataSource *ds = NULL;
+ AdapterDSource *ads = NULL;
+ AddressBookFile *abf = NULL;
+ AdapterInterface *adapter;
+ GtkCTreeNode *newNode;
+
+ abf = addrgather_dlg_execute( folderItem, _addressIndex_ );
+ if( abf ) {
+ ds = addrindex_index_add_datasource(
+ _addressIndex_, ADDR_IF_BOOK, abf );
+
+ adapter = addrbookctl_find_interface( ADDR_IF_BOOK );
+ if( adapter ) {
+ if( adapter->treeNode ) {
+ ads = addressbook_create_ds_adapter(
+ ds, ADDR_BOOK, addrbook_get_name( abf ) );
+ newNode = addressbook_add_object(
+ adapter->treeNode,
+ ADDRESS_OBJECT(ads) );
+ }
+ }
+
+ /* Notify address completion */
+ invalidate_address_completion();
+ }
+}
+
/*
* End of Source.
*/