changeset 23465:d60c3d1c6966

fixed some gobject stuff
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Sat, 21 Jun 2008 23:42:57 +0000
parents 9ffbfbcf307d
children 5a02912e0bac
files libpurple/sound-loader.c libpurple/sound-theme.c libpurple/sound-theme.h libpurple/theme-loader.c libpurple/theme-manager.c libpurple/theme.c
diffstat 6 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/sound-loader.c	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/sound-loader.c	Sat Jun 21 23:42:57 2008 +0000
@@ -70,14 +70,14 @@
 	/* Parse the tree */
 	theme = g_object_new(PURPLE_TYPE_SOUND_THEME, "type", "sound", NULL);
 		
-	purple_theme_set_name(theme->parent, xmlnode_get_attrib(root_node, THEME_NAME));
-	purple_theme_set_author(theme->parent, xmlnode_get_attrib(root_node, THEME_AUTHOR));
+	purple_theme_set_name(PURPLE_THEME(theme), xmlnode_get_attrib(root_node, THEME_NAME));
+	purple_theme_set_author(PURPLE_THEME(theme), xmlnode_get_attrib(root_node, THEME_AUTHOR));
 
 	image = g_build_filename(dir, xmlnode_get_attrib(root_node, THEME_IMAGE), NULL);
 	
 	sub_node = xmlnode_get_child(root_node, THEME_DESCRIPTION);
 	data = xmlnode_get_data(sub_node);
-	purple_theme_set_description(theme->parent, data);
+	purple_theme_set_description(PURPLE_THEME(theme), data);
 	xmlnode_free(sub_node);
 
 	while ((sub_node = xmlnode_get_child(root_node, THEME_SOUND_EVENT)) != NULL){
@@ -127,7 +127,7 @@
       NULL,   /* value table */
     };
     type = g_type_register_static (G_TYPE_OBJECT,
-                                   "PurpleSoundThemeLoaderType",
+                                   "PurpleSoundThemeLoader",
                                    &info, 0);
   }
   return type;
--- a/libpurple/sound-theme.c	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/sound-theme.c	Sat Jun 21 23:42:57 2008 +0000
@@ -103,8 +103,8 @@
       purple_sound_theme_init,    /* instance_init */
       NULL,   /* value table */
     };
-    type = g_type_register_static (G_TYPE_OBJECT,
-                                   "PurpleSoundThemeType",
+    type = g_type_register_static (PURPLE_TYPE_THEME,
+                                   "PurpleSoundTheme",
                                    &info, 0);
   }
   return type;
@@ -136,9 +136,9 @@
 
 	g_return_val_if_fail(PURPLE_IS_SOUND_THEME(theme), NULL);
 
-	dir = purple_theme_get_dir(theme->parent);
+	dir = purple_theme_get_dir(PURPLE_THEME(theme));
 	fname = purple_sound_theme_get_file(theme, event);
-	full = g_strconcat (dir, '/',fname, NULL);
+	full = g_build_filename(dir, fname, NULL);
 
 	g_free(dir);
 	g_free(fname);
--- a/libpurple/sound-theme.h	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/sound-theme.h	Sat Jun 21 23:42:57 2008 +0000
@@ -50,7 +50,7 @@
 
 struct _PurpleSoundTheme
 {
-	PurpleTheme *parent;
+	PurpleTheme parent;
 	gpointer priv;
 };
 
--- a/libpurple/theme-loader.c	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/theme-loader.c	Sat Jun 21 23:42:57 2008 +0000
@@ -43,7 +43,6 @@
 /******************************************************************************
  * Enums
  *****************************************************************************/
-#define PROP_TYPE_S "type"
 
 enum {
 	PROP_ZERO = 0,
@@ -109,10 +108,10 @@
 	obj_class->finalize = purple_theme_loader_finalize;
 
 	/* TYPE STRING (read only) */
-	pspec = g_param_spec_string(PROP_TYPE_S, "Type",
+	pspec = g_param_spec_string("type", "Type",
 				    "The string represtenting the type of the theme",
 				    NULL,
-				    G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY);
+				    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
 	g_object_class_install_property(obj_class, PROP_TYPE, pspec);
 }
 
--- a/libpurple/theme-manager.c	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/theme-manager.c	Sat Jun 21 23:42:57 2008 +0000
@@ -52,7 +52,7 @@
       NULL,   /* Value Table */
     };
     type = g_type_register_static (G_TYPE_OBJECT,
-                                   "PurpleThemeManagerType",
+                                   "PurpleThemeManager",
                                    &info, 0);
   }
   return type;
--- a/libpurple/theme.c	Sat Jun 21 05:55:58 2008 +0000
+++ b/libpurple/theme.c	Sat Jun 21 23:42:57 2008 +0000
@@ -194,7 +194,7 @@
 	/* PREVIEW IMAGE */
 	pspec = g_param_spec_pointer(PROP_IMAGE_S, "Image",
 				    "A preview image of the theme",
-				    G_PARAM_READABLE);
+				    G_PARAM_READWRITE);
 	g_object_class_install_property(obj_class, PROP_IMAGE, pspec);
 }
 
@@ -217,7 +217,7 @@
       NULL,   /* value table */
     };
     type = g_type_register_static (G_TYPE_OBJECT,
-                                   "PurpleThemeType",
+                                   "PurpleTheme",
                                    &info, G_TYPE_FLAG_ABSTRACT);
   }
   return type;