fix bug where opening folder has massive slowdown when using the 'Display sender...
[claws.git] / src / addrindex.c
index 7de4fda13cb76156df5eb2ec74d05176ffb22fc1..aa9c6ca041f4fd67a508e2e043d24e9b5d64aa72 100644 (file)
@@ -671,6 +671,22 @@ GList *addrindex_get_interface_list( AddressIndex *addrIndex ) {
        return addrIndex->interfaceList;
 }
 
+/**
+ * Perform any other initialization of address index.
+ * \param addrIndex Address index.
+ */
+void addrindex_initialize( AddressIndex *addrIndex ) {
+       addrcompl_initialize();
+}
+
+/**
+ * Perform any other teardown of address index.
+ * \param addrIndex Address index.
+ */
+void addrindex_teardown( AddressIndex *addrIndex ) {
+       addrcompl_teardown();
+}
+
 /**
  * Free up address index.
  * \param addrIndex Address index.
@@ -1354,7 +1370,7 @@ static AddressDataSource *addrindex_parse_ldap( XMLFile *file ) {
                attr = g_list_next( attr );
        }
 
-       server = ldapsvr_create();
+       server = ldapsvr_create_noctl();
        ldapsvr_set_name( server, serverName );
        ldapsvr_set_search_flag( server, bSearch );
        g_free( serverName );
@@ -1504,9 +1520,11 @@ static void addrindex_read_index( AddressIndex *addrIndex, XMLFile *file ) {
                                else if( addrIndex->lastType == ADDR_IF_JPILOT ) {
                                        ds = addrindex_parse_jpilot( file );
                                }
+#ifdef USE_LDAP
                                else if( addrIndex->lastType == ADDR_IF_LDAP ) {
                                        ds = addrindex_parse_ldap( file );
                                }
+#endif
                                if( ds ) {
                                        ds->interface = dsIFace;
                                        addrindex_hash_add_cache( addrIndex, ds );
@@ -1619,9 +1637,11 @@ static void addrindex_write_index( AddressIndex *addrIndex, FILE *fp ) {
                                        if( iface->type == ADDR_IF_JPILOT ) {
                                                addrindex_write_jpilot( fp, ds, lvlItem );
                                        }
+#ifdef USE_LDAP
                                        if( iface->type == ADDR_IF_LDAP ) {
                                                addrindex_write_ldap( fp, ds, lvlItem );
                                        }
+#endif
                                }
                                nodeDS = g_list_next( nodeDS );
                        }
@@ -2575,7 +2595,7 @@ static void addrindex_search_ldap( LdapServer *server, const gint queryID ) {
        gchar *name;
 
        if( ! server->searchFlag ) return;
-       printf( "Searching ::%s::\n", ldapsvr_get_name( server ) );
+       /* printf( "Searching ::%s::\n", ldapsvr_get_name( server ) ); */
 
        /* Retire any aged queries */
        ldapsvr_retire_query( server );