Changeset 2117

Show
Ignore:
Timestamp:
06/09/07 17:56:17 (1 year ago)
Author:
dgollub
Message:

Connect only once.
Build gnokii_calendar_utils.c

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/gnokii-sync/src/SConscript

    r2114 r2117  
    1010# basic vformat plugins 
    1111gnokii_sync = env.SharedLibrary('gnokii-sync', ['gnokii_sync.c', 'gnokii_calendar.c', 'gnokii_contact.c', 'gnokii_config.c', 'gnokii_comm.c'], LIBS = ['opensync', 'gnokii'], LIBPATH = '$prefix/$libsuffix') 
    12 gnokii_event = env.SharedLibrary('gnokii-event', ['gnokii_calendar_format.c'], LIBS = ['opensync'], LIBPATH = '$prefix/$libsuffix') 
     12gnokii_event = env.SharedLibrary('gnokii-event', ['gnokii_calendar_format.c', 'gnokii_calendar_utils.c'], LIBS = ['opensync'], LIBPATH = '$prefix/$libsuffix') 
    1313gnokii_contact = env.SharedLibrary('gnokii-contact', ['gnokii_contact_format.c', 'gnokii_contact_utils.c'], LIBS = ['opensync'], LIBPATH = '$prefix/$libsuffix') 
    1414 
  • plugins/gnokii-sync/src/gnokii_sync.c

    r2103 r2117  
    5050 
    5151        // connect to cellphone 
    52         if (!gnokii_comm_connect(env->state)) { 
     52        if (!env->connected && !gnokii_comm_connect(env->state)) { 
    5353                osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "Connection failed"); 
    5454                free_gnokiienv(env); 
    5555                return; 
     56        } else { 
     57                env->connected = TRUE; 
    5658        } 
    5759 
     
    102104         
    103105        // disconnect the connection with phone 
    104         if (!gnokii_comm_disconnect(env->state)) { 
     106        if (env->connected && !gnokii_comm_disconnect(env->state)) { 
    105107                osync_context_report_error(ctx, OSYNC_ERROR_GENERIC, "disconnect failed"); 
    106108                free_gnokiienv(env); 
    107109                return; 
     110        } else { 
     111                env->connected = FALSE; 
    108112        } 
    109113         
     
    174178 
    175179        env->sinks = NULL; 
     180        env->connected = FALSE; 
    176181 
    177182        env->state = osync_try_malloc0(sizeof(struct gn_statemachine), error); 
  • plugins/gnokii-sync/src/gnokii_sync.h

    r2099 r2117  
    4343        GList                   *sinks; // gnokii_sinkenv 
    4444        struct gn_statemachine  *state; 
     45        osync_bool              connected; 
    4546 
    4647} gnokii_environment;