Changeset 423

Show
Ignore:
Timestamp:
03/31/05 10:42:14 (4 years ago)
Author:
abauer
Message:

Added fail_unlesses for the batch commit functions of the
mock sync plugin.

Fixed the committed_all signal generation

Location:
trunk
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/formats/vformats-xml/xml-vcal.c

    r420 r423  
    348348static xmlNode *handle_organizer_attribute(xmlNode *root, VFormatAttribute *attr) 
    349349{ 
    350         osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); 
    351350        xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Organizer", NULL); 
    352351        osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); 
     
    356355static xmlNode *handle_recurid_attribute(xmlNode *root, VFormatAttribute *attr) 
    357356{ 
    358         osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); 
    359357        xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceID", NULL); 
    360358        osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); 
     
    364362static xmlNode *handle_status_attribute(xmlNode *root, VFormatAttribute *attr) 
    365363{ 
    366         osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); 
    367364        xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Status", NULL); 
    368365        osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); 
     
    372369static xmlNode *handle_duration_attribute(xmlNode *root, VFormatAttribute *attr) 
    373370{ 
    374         osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); 
    375371        xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Duration", NULL); 
    376372        osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); 
  • trunk/opensync/opensync_debug.c

    r361 r423  
    127127/*! @brief Used for debugging 
    128128 *  
    129  * Used for debugging. Severity ranges from 0=Error to 5=Full Debug 
     129 * Used for debugging. Severity ranges from 0=Error to 4=Full Debug 
    130130 *  
    131131 * @param subpart String to identify the subpart (and filter on it) 
  • trunk/osengine/osengine_engine.c

    r421 r423  
    339339        OSyncPluginTimeouts timeouts = osync_client_get_timeouts(entry->client); 
    340340        itm_queue_send_with_timeout(entry->client->incoming, message, timeouts.commit_timeout, sender); 
     341         
     342        g_assert(osync_flag_is_attached(entry->fl_committed) == TRUE); 
     343        osync_flag_detach(entry->fl_committed); 
    341344} 
    342345 
     
    519522} 
    520523 
    521 static void trigger_engine_multiplied(OSyncEngine *engine) 
     524static void trigger_engine_committed_all(OSyncEngine *engine) 
    522525{ 
    523526        osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine); 
     
    587590        osync_flag_set_state(engine->cmb_connected, FALSE); 
    588591        osync_flag_set_state(engine->cmb_read_all, TRUE); 
    589         osync_flag_set_state(engine->cmb_multiplied, FALSE); 
     592        osync_flag_set_state(engine->cmb_committed_all, TRUE); 
    590593        itm_queue_flush(engine->incoming); 
    591594         
     
    675678        osync_flag_set_pos_trigger(engine->cmb_chkconflict, (OSyncFlagTriggerFunc)trigger_status_end_conflicts, engine, NULL); 
    676679         
    677         engine->cmb_multiplied = osync_comb_flag_new(FALSE, FALSE); 
    678         osync_flag_set_pos_trigger(engine->cmb_multiplied, (OSyncFlagTriggerFunc)trigger_engine_multiplied, engine, NULL); 
     680        engine->cmb_committed_all = osync_comb_flag_new(FALSE, TRUE); 
     681        osync_flag_set_pos_trigger(engine->cmb_committed_all, (OSyncFlagTriggerFunc)trigger_engine_committed_all, engine, NULL); 
    679682         
    680683        osync_flag_set(engine->fl_sync); 
     
    722725        osync_flag_free(engine->cmb_connected); 
    723726        osync_flag_free(engine->cmb_read_all); 
    724         osync_flag_free(engine->cmb_multiplied); 
     727        osync_flag_free(engine->cmb_committed_all); 
    725728         
    726729        itm_queue_flush(engine->incoming); 
  • trunk/osengine/osengine_engine_internals.h

    r421 r423  
    4646        OSyncFlag *cmb_chkconflict; 
    4747        OSyncFlag *cmb_read_all; 
    48         OSyncFlag *cmb_multiplied; 
     48        //OSyncFlag *cmb_multiplied; 
     49        OSyncFlag *cmb_committed_all; 
    4950         
    5051        osync_bool man_dispatch; 
  • trunk/osengine/osengine_flags.c

    r421 r423  
    6161        } 
    6262        osync_flag_calculate_comb(target); 
     63} 
     64 
     65osync_bool osync_flag_is_attached(OSyncFlag *flag) 
     66{ 
     67        if (flag->comb_flag) 
     68                return TRUE; 
     69        return FALSE; 
    6370} 
    6471 
  • trunk/osengine/osengine_flags_internals.h

    r421 r423  
    5151void osync_flag_attach(OSyncFlag *flag, OSyncFlag *target); 
    5252void osync_flag_detach(OSyncFlag *flag); 
     53osync_bool osync_flag_is_attached(OSyncFlag *flag); 
  • trunk/osengine/osengine_mapcmds.c

    r416 r423  
    120120        if (osync_flag_is_not_set(master->fl_dirty)) 
    121121                osync_flag_set(master->fl_synced); 
    122          
     122        else 
     123                osync_flag_attach(master->fl_committed, table->engine->cmb_committed_all); 
     124                 
    123125        //Send the change to every source that is different to the master source and set state to writing in the changes 
    124126        GList *v; 
     
    163165                        OSyncError *error = NULL; 
    164166                        osync_change_save(entry->change, TRUE, &error); 
     167                        osync_flag_attach(entry->fl_committed, table->engine->cmb_committed_all); 
    165168                } 
    166169        } 
  • trunk/osengine/osengine_mapping.c

    r421 r423  
    291291                osync_flag_attach(mapping->cmb_synced, table->engine->cmb_synced); 
    292292                osync_flag_attach(mapping->fl_chkconflict, table->engine->cmb_chkconflict); 
    293                 osync_flag_attach(mapping->fl_multiplied, table->engine->cmb_multiplied); 
    294293        } 
    295294        osync_trace(TRACE_INTERNAL, "osengine_mapping_new(%p): %p", table, mapping); 
     
    492491        entry->fl_deleted = osync_flag_new(NULL); 
    493492        entry->fl_read = osync_flag_new(NULL); 
     493        entry->fl_committed = osync_flag_new(NULL); 
    494494        osync_flag_set(entry->fl_synced); 
    495495         
     
    514514        osync_flag_free(entry->fl_deleted); 
    515515        osync_flag_free(entry->fl_read); 
     516        osync_flag_free(entry->fl_committed); 
    516517         
    517518        entry->view->changes = g_list_remove(entry->view->changes, entry); 
  • trunk/osengine/osengine_mapping_internals.h

    r421 r423  
    4646        OSyncFlag *fl_deleted; 
    4747        OSyncFlag *fl_read; 
     48        OSyncFlag *fl_committed; 
    4849}; 
    4950#endif 
  • trunk/tests/mock-plugin/mock_sync.c

    r422 r423  
    298298        mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); 
    299299         
    300         //fail_unless(env->committed_all == FALSE, NULL); 
     300        fail_unless(env->committed_all == FALSE, NULL); 
    301301         
    302302        char *filename = NULL; 
     
    350350        mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); 
    351351         
    352         //fail_unless(env->committed_all == FALSE, NULL); 
     352        fail_unless(env->committed_all == FALSE, NULL); 
    353353         
    354354        if (mock_get_error(env->member, "COMMIT_ERROR")) {