ges: Keep ges-gerror categories simple.

This commit is contained in:
Thibault Saunier 2013-03-22 17:39:04 -03:00
parent fa5ed5111d
commit c84f4ec9fb
5 changed files with 19 additions and 35 deletions

View file

@ -24,10 +24,8 @@ GESAssetLoadingReturn
<SECTION> <SECTION>
<FILE>ges-gerror</FILE> <FILE>ges-gerror</FILE>
<TITLE>GES GErrors</TITLE> <TITLE>GES GErrors</TITLE>
GES_ASSET_ERROR GES_ERROR
GES_FORMATTER_ERROR GESError
GESAssetError
GESFormatterError
</SECTION> </SECTION>
<SECTION> <SECTION>

View file

@ -171,7 +171,7 @@ _check_and_update_parameters (GType * extractable_type, const gchar * id,
g_type_name (old_type)); g_type_name (old_type));
if (error && *error == NULL) if (error && *error == NULL)
g_set_error (error, GES_ASSET_ERROR, GES_ASSET_WRONG_ID, g_set_error (error, GES_ERROR, GES_ERROR_ASSET_WRONG_ID,
"Wrong ID, can not find any extractable_type"); "Wrong ID, can not find any extractable_type");
return NULL; return NULL;
} }
@ -182,7 +182,7 @@ _check_and_update_parameters (GType * extractable_type, const gchar * id,
g_free (real_id); g_free (real_id);
if (error && *error == NULL) if (error && *error == NULL)
g_set_error (error, GES_ASSET_ERROR, GES_ASSET_WRONG_ID, "Wrong ID"); g_set_error (error, GES_ERROR, GES_ERROR_ASSET_WRONG_ID, "Wrong ID");
return NULL; return NULL;
} }
@ -224,7 +224,7 @@ async_initable_init_async (GAsyncInitable * initable, gint io_priority,
case GES_ASSET_LOADING_ERROR: case GES_ASSET_LOADING_ERROR:
{ {
if (error == NULL) if (error == NULL)
g_set_error (&error, GES_ASSET_ERROR, GES_ASSET_ERROR_LOADING, g_set_error (&error, GES_ERROR, GES_ERROR_ASSET_LOADING,
"Could not start loading asset"); "Could not start loading asset");
/* FIXME Define error code */ /* FIXME Define error code */

View file

@ -688,7 +688,7 @@ ges_base_xml_formatter_add_clip (GESBaseXmlFormatter * self,
entry = g_hash_table_lookup (priv->layers, GINT_TO_POINTER (layer_prio)); entry = g_hash_table_lookup (priv->layers, GINT_TO_POINTER (layer_prio));
if (entry == NULL) { if (entry == NULL) {
g_set_error (error, GES_FORMATTER_ERROR, GES_FORMATTER_WRONG_INPUT_FILE, g_set_error (error, GES_ERROR, GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE,
"We got a Clip in a layer" "We got a Clip in a layer"
" that does not exist, something is wrong either in the project file or" " that does not exist, something is wrong either in the project file or"
" in %s", g_type_name (G_OBJECT_TYPE (self))); " in %s", g_type_name (G_OBJECT_TYPE (self)));

View file

@ -28,38 +28,24 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/** /**
* GES_ASSET_ERROR: * GES_ERROR:
* *
* An error happend using an asset * An error happend in GES
*/ */
#define GES_ASSET_ERROR g_quark_from_static_string("GES_ASSET_ERROR") #define GES_ERROR g_quark_from_static_string("GES_ERROR")
/** /**
* GES_FORMATTER_ERROR: * GESError:
* * @GES_ERROR_ASSET_WRONG_ID: The ID passed is malformed
* An error happend using a formatter * @GES_ERROR_ASSET_LOADING: An error happened while loading the asset
*/ * @GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE: The formatted files was malformed
#define GES_FORMATTER_ERROR g_quark_from_static_string("GES_FORMATTER_ERROR")
/**
* GESAssetError:
* @GES_ASSET_WRONG_ID: The ID passed is malformed
* @GES_ASSET_ERROR_LOADING: An error happened while loading the asset
*/ */
typedef enum typedef enum
{ {
GES_ASSET_WRONG_ID, GES_ERROR_ASSET_WRONG_ID,
GES_ASSET_ERROR_LOADING GES_ERROR_ASSET_LOADING,
} GESAssetError; GES_ERROR_FORMATTER_MALFORMED_INPUT_FILE,
} GESError;
/**
* GESFormatterError:
* @GES_FORMATTER_WRONG_INPUT_FILE: The formatted files was malformed
*/
typedef enum
{
GES_FORMATTER_WRONG_INPUT_FILE,
} GESFormatterError;
G_END_DECLS G_END_DECLS
#endif /* __GES_ERROR_H__ */ #endif /* __GES_ERROR_H__ */

View file

@ -448,8 +448,8 @@ ges_uri_clip_asset_request_sync (const gchar * uri, GError ** error)
if (asset) if (asset)
return asset; return asset;
if (lerror && lerror->domain == GES_ASSET_ERROR && if (lerror && lerror->domain == GES_ERROR &&
lerror->code == GES_ASSET_WRONG_ID) { lerror->code == GES_ERROR_ASSET_WRONG_ID) {
g_propagate_error (error, lerror); g_propagate_error (error, lerror);
return NULL; return NULL;