G_OBJECT_CLASS (zak_audit_parent_class)->finalize (gobject);
}
+static gboolean
+zak_audit_set_gda_connection_with_datasources_v (ZakAudit *zak_audit, GdaConnection *gda_connection, va_list ap)
+{
+ ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
+
+ priv->gdaex = gdaex_new_from_connection (gda_connection);
+
+ if (priv->gdaex == NULL)
+ {
+ /* TODO */
+ g_warning (_("Error creating GdaEx object."));
+ return FALSE;
+ }
+
+ /* loading datasources */
+ if (!load_datasources (zak_audit, ap))
+ {
+ /* TODO */
+ g_warning (_("Error loading datasources."));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static gboolean
+zak_audit_set_cnc_string_with_datasources_v (ZakAudit *zak_audit, const gchar *cnc_string, va_list ap)
+{
+ ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
+
+ priv->gdaex = gdaex_new_from_string (cnc_string);
+
+ if (priv->gdaex == NULL)
+ {
+ /* TODO */
+ g_warning (_("Error creating GdaEx object."));
+ return FALSE;
+ }
+
+ /* loading datasources */
+ if (!load_datasources (zak_audit, ap))
+ {
+ /* TODO */
+ g_warning (_("Error loading datasources."));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
/* PUBLIC */
/**
* zak_audit_new_with_datasources:
va_start (ap, gda_connection);
- if (!zak_audit_set_gda_connection_with_datasources (zak_audit, gda_connection, ap))
+ if (!zak_audit_set_gda_connection_with_datasources_v (zak_audit, gda_connection, ap))
{
g_clear_object (&zak_audit);
}
va_start (ap, cnc_string);
- if (!zak_audit_set_cnc_string_with_datasources (zak_audit, cnc_string, ap))
+ if (!zak_audit_set_cnc_string_with_datasources_v (zak_audit, cnc_string, ap))
{
g_clear_object (&zak_audit);
}
gboolean
zak_audit_set_gda_connection_with_datasources (ZakAudit *zak_audit, GdaConnection *gda_connection, ...)
{
+ gboolean ret;
+
va_list ap;
g_return_val_if_fail (IS_ZAK_AUDIT (zak_audit), FALSE);
- ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
-
- priv->gdaex = gdaex_new_from_connection (gda_connection);
-
- if (priv->gdaex == NULL)
- {
- /* TODO */
- g_warning (_("Error creating GdaEx object."));
- return FALSE;
- }
-
va_start (ap, gda_connection);
- /* carico i datasource */
- if (!load_datasources (zak_audit, ap))
- {
- /* TODO */
- g_warning (_("Error loading datasources."));
- return FALSE;
- }
+ ret = zak_audit_set_gda_connection_with_datasources_v (zak_audit, gda_connection, ap);
va_end (ap);
- return TRUE;
+ return ret;
}
gboolean
gboolean
zak_audit_set_cnc_string_with_datasources (ZakAudit *zak_audit, const gchar *cnc_string, ...)
{
+ gboolean ret;
+
va_list ap;
g_return_val_if_fail (IS_ZAK_AUDIT (zak_audit), FALSE);
- ZakAuditPrivate *priv = ZAK_AUDIT_GET_PRIVATE (zak_audit);
-
- priv->gdaex = gdaex_new_from_string (cnc_string);
-
- if (priv->gdaex == NULL)
- {
- /* TODO */
- g_warning (_("Error creating GdaEx object."));
- return FALSE;
- }
-
va_start (ap, cnc_string);
- /* carico i datasource */
- if (!load_datasources (zak_audit, ap))
- {
- /* TODO */
- g_warning (_("Error loading datasources."));
- return FALSE;
- }
+ ret = zak_audit_set_cnc_string_with_datasources_v (zak_audit, cnc_string, ap);
va_end (ap);
- return TRUE;
+ return ret;
}
/**