| 582 | | OSyncList *r = osync_plugin_config_get_ressources(config); |
|---|
| 583 | | for (; r; r = r->next) { |
|---|
| 584 | | OSyncPluginRessource *res = r->data; |
|---|
| 585 | | |
|---|
| 586 | | OSyncList *o = osync_plugin_ressource_get_objformat_sinks(res); |
|---|
| 587 | | for (; o; o = o->next) { |
|---|
| 588 | | OSyncObjFormatSink *format_sink = (OSyncObjFormatSink *) o->data; |
|---|
| 589 | | const char *objformat_str = osync_objformat_sink_get_objformat(format_sink); |
|---|
| 590 | | osync_assert(objformat_str); |
|---|
| 591 | | OSyncObjFormat *objformat = osync_format_env_find_objformat(formatenv, objformat_str); |
|---|
| 592 | | osync_assert(objformat); |
|---|
| 593 | | const char *objtype = osync_objformat_get_objtype(objformat); |
|---|
| 594 | | osync_assert(objtype); |
|---|
| 595 | | if (!strcmp(objtype, osync_objtype_sink_get_name(sink))) { |
|---|
| 596 | | dir->res = osync_plugin_ressource_ref(res); |
|---|
| 597 | | dir->path = g_strdup(osync_plugin_ressource_get_path(res)); |
|---|
| 598 | | dir->objformat = osync_objformat_ref(objformat); |
|---|
| 599 | | break; |
|---|
| 600 | | } |
|---|
| 601 | | |
|---|
| 602 | | } |
|---|
| 603 | | |
|---|
| 604 | | if (dir->res) |
|---|
| 605 | | break; |
|---|
| 606 | | } |
|---|
| | 582 | const char *objtype = osync_objtype_sink_get_name(sink); |
|---|
| | 583 | dir->res = osync_plugin_config_find_active_ressource(config, objtype); |
|---|
| | 584 | dir->path = osync_plugin_ressource_get_path(dir->res); |
|---|
| | 585 | osync_assert(dir->path); |
|---|
| | 586 | |
|---|
| | 587 | OSyncList *format_sinks = osync_plugin_ressource_get_objformat_sinks(dir->res); |
|---|
| | 588 | osync_assert(osync_list_length(format_sinks) == 1); |
|---|
| | 589 | OSyncObjFormatSink *format_sink = osync_list_nth_data(format_sinks, 0); |
|---|
| | 590 | const char *objformat_str = osync_objformat_sink_get_objformat(format_sink); |
|---|
| | 591 | osync_assert(objformat_str); |
|---|
| | 592 | dir->objformat = osync_format_env_find_objformat(formatenv, objformat_str); |
|---|
| | 593 | osync_assert(dir->objformat); |
|---|
| | 594 | osync_objformat_ref(dir->objformat); |
|---|