Re: Wizard patch

Michael Terry <[email protected]> Mon, 30 Jun 2008 09:20:22 -0400
Newsgroups gmane.linux.bluez.devel
Message-ID <1214832022.6764.10.camel@bongo>
On Mon, 2008-06-30 at 14:57 +0200, Marcel Holtmann wrote:
> please use the coding style that is present in the file you are
> working
> on. This includes whitespaces and indentation.

Sure.  I thought I did, but I missed a tab, which is what I assume you
were referring to?

Tab-complete patch attached.

-mt

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
selector2.diff (text/x-patch, 2.3 KB)
Index: common/bluetooth-device-selection.c
===================================================================
RCS file: /cvsroot/bluez/gnome/common/bluetooth-device-selection.c,v
retrieving revision 1.23
diff -u -p -r1.23 bluetooth-device-selection.c
--- common/bluetooth-device-selection.c	30 Jun 2008 07:59:29 -0000	1.23
+++ common/bluetooth-device-selection.c	30 Jun 2008 13:17:43 -0000
@@ -91,6 +91,15 @@ bluetooth_device_category_to_string (int
 	}
 }
 
+static int
+int_log2(int v)
+{
+	int rv = 0;
+	while (v >>= 1)
+		rv++;
+	return rv;
+}
+
 static void
 name_to_text (GtkTreeViewColumn *column, GtkCellRenderer *cell,
 	      GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
@@ -609,7 +618,7 @@ bluetooth_device_selection_init(Bluetoot
 	}
 	g_signal_connect (G_OBJECT (priv->device_type), "changed",
 			  G_CALLBACK(filter_type_changed_cb), self);
-	gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), priv->device_type_filter);
+	gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), int_log2(priv->device_type_filter));
 	if (priv->show_device_type) {
 		gtk_widget_show (priv->device_type_label);
 		gtk_widget_show (priv->device_type);
@@ -696,7 +705,7 @@ bluetooth_device_selection_set_property 
 		break;
 	case PROP_DEVICE_TYPE_FILTER:
 		priv->device_type_filter = g_value_get_int (value);
-		gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), priv->device_type_filter >> 1);
+		gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), int_log2(priv->device_type_filter));
 		break;
 	case PROP_DEVICE_CATEGORY_FILTER:
 		priv->device_category_filter = g_value_get_int (value);
@@ -788,7 +797,7 @@ bluetooth_device_selection_class_init (B
 											  NULL, NULL, TRUE, G_PARAM_READWRITE));
 	g_object_class_install_property (G_OBJECT_CLASS(klass),
 					 PROP_DEVICE_TYPE_FILTER, g_param_spec_int ("device-type-filter", NULL, NULL,
-										    0, BLUETOOTH_TYPE_NUM_TYPES, 0, G_PARAM_READWRITE));
+										    1, 1 << (BLUETOOTH_TYPE_NUM_TYPES-1), 1, G_PARAM_READWRITE));
 	g_object_class_install_property (G_OBJECT_CLASS(klass),
 					 PROP_DEVICE_CATEGORY_FILTER, g_param_spec_int ("device-category-filter", NULL, NULL,
 					 						0, BLUETOOTH_CATEGORY_NUM_CATEGORIES, 0, G_PARAM_READWRITE));
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBIaN2W53i2YxNrdi0RAtVEAJ0SiBsFbrDr8BR11Zx4l4Y/ID74YgCfT05J
DsoIuf5WfIhmWzs7n/ksqSA=
=sHFw
-----END PGP SIGNATURE-----