diff -r 312d6bc514f3 -r cb885ee44618 gmyth/src/gmyth_recprofile.c --- a/gmyth/src/gmyth_recprofile.c Thu Jun 14 18:19:52 2007 +0100 +++ b/gmyth/src/gmyth_recprofile.c Thu Jun 14 20:40:47 2007 +0100 @@ -37,19 +37,20 @@ #include "gmyth_debug.h" #include "gmyth_http.h" -static void gmyth_recprofile_class_init(GMythRecProfileClass * klass); -static void gmyth_recprofile_init(GMythRecProfile * object); +static void gmyth_recprofile_class_init(GMythRecProfileClass * klass); +static void gmyth_recprofile_init(GMythRecProfile * object); -static void gmyth_recprofile_dispose(GObject * object); -static void gmyth_recprofile_finalize(GObject * object); +static void gmyth_recprofile_dispose(GObject * object); +static void gmyth_recprofile_finalize(GObject * object); G_DEFINE_TYPE(GMythRecProfile, gmyth_recprofile, G_TYPE_OBJECT) - static void gmyth_recprofile_class_init(GMythRecProfileClass * klass) + static void gmyth_recprofile_class_init(GMythRecProfileClass * + klass) { - GObjectClass *gobject_class = G_OBJECT_CLASS(klass); + GObjectClass *gobject_class = G_OBJECT_CLASS(klass); - gobject_class->dispose = gmyth_recprofile_dispose; - gobject_class->finalize = gmyth_recprofile_finalize; + gobject_class->dispose = gmyth_recprofile_dispose; + gobject_class->finalize = gmyth_recprofile_finalize; } static void @@ -60,31 +61,31 @@ static void gmyth_recprofile_dispose(GObject * object) { - GMythRecProfile *recprofile = GMYTH_RECPROFILE(object); + GMythRecProfile *recprofile = GMYTH_RECPROFILE(object); - if (recprofile->name) - g_free(recprofile->name); + if (recprofile->name) + g_free(recprofile->name); - if (recprofile->group) - g_free(recprofile->group); + if (recprofile->group) + g_free(recprofile->group); - if (recprofile->vcodec) - g_free(recprofile->vcodec); + if (recprofile->vcodec) + g_free(recprofile->vcodec); - if (recprofile->acodec) - g_free(recprofile->acodec); + if (recprofile->acodec) + g_free(recprofile->acodec); - if (recprofile->options) - g_free(recprofile->options); + if (recprofile->options) + g_free(recprofile->options); - G_OBJECT_CLASS(gmyth_recprofile_parent_class)->dispose(object); + G_OBJECT_CLASS(gmyth_recprofile_parent_class)->dispose(object); } static void gmyth_recprofile_finalize(GObject * object) { - g_signal_handlers_destroy(object); - G_OBJECT_CLASS(gmyth_recprofile_parent_class)->finalize(object); + g_signal_handlers_destroy(object); + G_OBJECT_CLASS(gmyth_recprofile_parent_class)->finalize(object); } /** @@ -95,17 +96,17 @@ GMythRecProfile * gmyth_recprofile_new(void) { - GMythRecProfile *recprofile = GMYTH_RECPROFILE - (g_object_new(GMYTH_RECPROFILE_TYPE, NULL)); + GMythRecProfile *recprofile = GMYTH_RECPROFILE + (g_object_new(GMYTH_RECPROFILE_TYPE, NULL)); - recprofile->id = 0; - recprofile->name = NULL; - recprofile->group = NULL; - recprofile->vcodec = NULL; - recprofile->acodec = NULL; - recprofile->options = NULL; + recprofile->id = 0; + recprofile->name = NULL; + recprofile->group = NULL; + recprofile->vcodec = NULL; + recprofile->acodec = NULL; + recprofile->options = NULL; - return recprofile; + return recprofile; } @@ -117,10 +118,10 @@ * @return GSList * **/ -GSList * +GSList * gmyth_recprofile_get_profile_list(GMythBackendInfo * backend_info) { - return gmyth_http_retrieve_rec_profiles(backend_info, "Transcoders"); + return gmyth_http_retrieve_rec_profiles(backend_info, "Transcoders"); } /** @@ -134,9 +135,9 @@ **/ gint gmyth_recprofile_create_profile(GMythBackendInfo * backend_info, - GMythRecProfile * profile) + GMythRecProfile * profile) { - return gmyth_http_create_rec_profile(backend_info, profile); + return gmyth_http_create_rec_profile(backend_info, profile); } /** @@ -151,7 +152,7 @@ gint gmyth_recprofile_del_profile_list(GMythBackendInfo * backend_info, gint id) { - return gmyth_http_del_rec_profile(backend_info, id); + return gmyth_http_del_rec_profile(backend_info, id); } /** @@ -166,8 +167,8 @@ gint gmyth_recprofile_set_id(GMythRecProfile * rec, gint id) { - rec->id = id; - return 0; + rec->id = id; + return 0; } /** @@ -183,25 +184,23 @@ gint gmyth_recprofile_set(GMythRecProfile * rec, gchar * member, gchar * value) { - int ret = 0; + int ret = 0; - if (value != NULL) - { - if (g_ascii_strcasecmp(member, "name") == 0) - rec->name = g_strndup(value, strlen(value)); - else if (g_ascii_strcasecmp(member, "group") == 0) - rec->group = g_strndup(value, strlen(value)); - else if (g_ascii_strcasecmp(member, "vcodec") == 0) - rec->vcodec = g_strndup(value, strlen(value)); - else if (g_ascii_strcasecmp(member, "acodec") == 0) - rec->acodec = g_strndup(value, strlen(value)); - else - ret = -1; - } - else - ret = -1; + if (value != NULL) { + if (g_ascii_strcasecmp(member, "name") == 0) + rec->name = g_strndup(value, strlen(value)); + else if (g_ascii_strcasecmp(member, "group") == 0) + rec->group = g_strndup(value, strlen(value)); + else if (g_ascii_strcasecmp(member, "vcodec") == 0) + rec->vcodec = g_strndup(value, strlen(value)); + else if (g_ascii_strcasecmp(member, "acodec") == 0) + rec->acodec = g_strndup(value, strlen(value)); + else + ret = -1; + } else + ret = -1; - return ret; + return ret; } /** @@ -216,7 +215,7 @@ gint gmyth_recprofile_set_name(GMythRecProfile * rec, gchar * name) { - return gmyth_recprofile_set(rec, "name", name); + return gmyth_recprofile_set(rec, "name", name); } /** @@ -231,7 +230,7 @@ gint gmyth_recprofile_set_group(GMythRecProfile * rec, gchar * group) { - return gmyth_recprofile_set(rec, "group", group); + return gmyth_recprofile_set(rec, "group", group); } /** @@ -246,7 +245,7 @@ gint gmyth_recprofile_set_vcodec(GMythRecProfile * rec, gchar * vcodec) { - return gmyth_recprofile_set(rec, "vcodec", vcodec); + return gmyth_recprofile_set(rec, "vcodec", vcodec); } /** @@ -261,5 +260,5 @@ gint gmyth_recprofile_set_acodec(GMythRecProfile * rec, gchar * acodec) { - return gmyth_recprofile_set(rec, "acodec", acodec); + return gmyth_recprofile_set(rec, "acodec", acodec); }