pidgin: d24e3e43: Remove extra enumeration.

qulogic at pidgin.im qulogic at pidgin.im
Sat Feb 20 02:13:19 EST 2010


-----------------------------------------------------------------
Revision: d24e3e43792c97ead68b3833f45ea35c4de8128c
Ancestor: 01227b6f027e973ca36dd44d581d5895f6453075
Author: qulogic at pidgin.im
Date: 2010-02-20T04:33:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d24e3e43792c97ead68b3833f45ea35c4de8128c

Modified files:
        pidgin/gtksavedstatuses.c

ChangeLog: 

Remove extra enumeration.

-------------- next part --------------
============================================================
--- pidgin/gtksavedstatuses.c	6488f54e7d56d6e394da0a19e6b3880797522f77
+++ pidgin/gtksavedstatuses.c	bf1e5717efb4f7bdb42c5d024d4aafb21c58f47a
@@ -85,17 +85,16 @@ enum
 };
 
 /**
- * These are used in the GtkComboBox to select the specific
- * PurpleStatusType when setting a substatus for a particular saved
- * status.
+ * These are used in the GtkComboBox to select the specific PurpleStatusType
+ * when setting a (sub)status for a particular saved status.
  */
 enum
 {
-	SUBSTATUS_COLUMN_ICON,
+	STATUS_COLUMN_ICON,
 	/** A hidden column containing the ID of this PurpleStatusType. */
-	SUBSTATUS_COLUMN_STATUS_ID,
-	SUBSTATUS_COLUMN_STATUS_NAME,
-	SUBSTATUS_NUM_COLUMNS
+	STATUS_COLUMN_STATUS_ID,
+	STATUS_COLUMN_STATUS_NAME,
+	STATUS_NUM_COLUMNS
 };
 
 typedef struct
@@ -836,12 +835,6 @@ editor_title_changed_cb(GtkWidget *widge
 	gtk_widget_set_sensitive(GTK_WIDGET(dialog->save_button), (*text != '\0'));
 }
 
-enum {
-	STATUS_MENU_STOCK_ICON,
-	STATUS_MENU_NAME,
-	STATUS_MENU_COUNT
-};
-
 static GtkWidget *
 create_status_type_menu(PurpleStatusPrimitive type)
 {
@@ -851,7 +844,7 @@ create_status_type_menu(PurpleStatusPrim
 	GtkTreeIter iter;
 	GtkCellRenderer *renderer;
 
-	store = gtk_list_store_new(STATUS_MENU_COUNT, G_TYPE_STRING, G_TYPE_STRING);
+	store = gtk_list_store_new(STATUS_NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
 
 	for (i = PURPLE_STATUS_UNSET + 1; i < PURPLE_STATUS_NUM_PRIMITIVES; i++)
 	{
@@ -863,10 +856,10 @@ create_status_type_menu(PurpleStatusPrim
 			continue;
 
 		gtk_list_store_append(store, &iter);
-		/* TODO: how's this get the right size (since it seems to work fine)? */
 		gtk_list_store_set(store, &iter,
-		                   STATUS_MENU_STOCK_ICON, get_stock_icon_from_primitive(i),
-		                   STATUS_MENU_NAME, purple_primitive_get_name_from_type(i),
+		                   STATUS_COLUMN_ICON, get_stock_icon_from_primitive(i),
+		                   STATUS_COLUMN_STATUS_ID, purple_primitive_get_id_from_type(i),
+		                   STATUS_COLUMN_STATUS_NAME, purple_primitive_get_name_from_type(i),
 		                   -1);
 	}
 
@@ -875,13 +868,13 @@ create_status_type_menu(PurpleStatusPrim
 	renderer = gtk_cell_renderer_pixbuf_new();
 	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, FALSE);
 	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer,
-	                               "stock-id", STATUS_MENU_STOCK_ICON,
+	                               "stock-id", STATUS_COLUMN_ICON,
 	                               NULL);
 
 	renderer = gtk_cell_renderer_text_new();
 	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE);
 	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer,
-	                               "text", STATUS_MENU_NAME,
+	                               "text", STATUS_COLUMN_STATUS_NAME,
 	                               NULL);
 
 	gtk_combo_box_set_active(GTK_COMBO_BOX(dropdown),
@@ -1270,7 +1263,7 @@ substatus_selection_changed_cb(GtkComboB
 	if (!gtk_combo_box_get_active_iter(box, &iter))
 		return;
 	gtk_tree_model_get(GTK_TREE_MODEL(select->model), &iter,
-					   SUBSTATUS_COLUMN_STATUS_ID, &id,
+					   STATUS_COLUMN_STATUS_ID, &id,
 					   -1);
 	type = purple_account_get_status_type(select->account, id);
 	g_free(id);
@@ -1361,7 +1354,7 @@ substatus_editor_ok_cb(GtkButton *button
 	}
 
 	gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter,
-					   SUBSTATUS_COLUMN_STATUS_ID, &id,
+					   STATUS_COLUMN_STATUS_ID, &id,
 					   -1);
 	type = purple_account_get_status_type(dialog->account, id);
 	if (purple_status_type_get_attr(type, "message") != NULL)
@@ -1451,7 +1444,7 @@ edit_substatus(StatusEditor *status_edit
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 	gtk_size_group_add_widget(sg, label);
 
-	dialog->model = gtk_list_store_new(SUBSTATUS_NUM_COLUMNS,
+	dialog->model = gtk_list_store_new(STATUS_NUM_COLUMNS,
 									   G_TYPE_STRING,
 									   G_TYPE_STRING,
 									   G_TYPE_STRING);
@@ -1464,12 +1457,12 @@ edit_substatus(StatusEditor *status_edit
 			NULL);
 	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, FALSE);
 	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend,
-						"stock-id", SUBSTATUS_COLUMN_ICON, NULL);
+						"stock-id", STATUS_COLUMN_ICON, NULL);
 
 	rend = GTK_CELL_RENDERER(gtk_cell_renderer_text_new());
 	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), rend, TRUE);
 	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), rend,
-						"text", SUBSTATUS_COLUMN_STATUS_NAME, NULL);
+						"text", STATUS_COLUMN_STATUS_NAME, NULL);
 
 	g_signal_connect(G_OBJECT(combo), "changed",
 					 G_CALLBACK(substatus_selection_changed_cb), dialog);
@@ -1545,9 +1538,9 @@ edit_substatus(StatusEditor *status_edit
 
 		gtk_list_store_append(dialog->model, &iter);
 		gtk_list_store_set(dialog->model, &iter,
-						   SUBSTATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim),
-						   SUBSTATUS_COLUMN_STATUS_ID, id,
-						   SUBSTATUS_COLUMN_STATUS_NAME, name,
+						   STATUS_COLUMN_ICON, pidgin_stock_id_from_status_primitive(prim),
+						   STATUS_COLUMN_STATUS_ID, id,
+						   STATUS_COLUMN_STATUS_NAME, name,
 						   -1);
 		if ((status_id != NULL) && !strcmp(status_id, id))
 		{


More information about the Commits mailing list