static char * get_url_or_path (BuilderSourceGit *self, BuilderContext *context, GError **error) { g_autoptr(GFile) repo = NULL; GFile *base_dir = BUILDER_SOURCE (self)->base_dir; if (self->url == NULL && self->path == NULL) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "No URL or path specified"); return NULL; } if (self->url) { g_autofree char *scheme = NULL; scheme = g_uri_parse_scheme (self->url); if (scheme == NULL) { repo = g_file_resolve_relative_path (base_dir, self->url); return g_file_get_uri (repo); } return g_strdup (self->url); } repo = g_file_resolve_relative_path (base_dir, self->path); return g_file_get_path (repo); }
static void builder_source_finalize (GObject *object) { BuilderSource *self = BUILDER_SOURCE (object); g_free (self->dest); G_OBJECT_CLASS (builder_source_parent_class)->finalize (object); }
static void builder_source_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { BuilderSource *self = BUILDER_SOURCE (object); switch (prop_id) { case PROP_DEST: g_value_set_string (value, self->dest); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }