[gnome-bluetooth] settings: Never have nameless rows
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] settings: Never have nameless rows
- Date: Sat, 7 Dec 2013 10:31:28 +0000 (UTC)
commit 89328b1d2174eaffd138d6dc711581f6f87154f1
Author: Bastien Nocera <hadess hadess net>
Date: Sat Dec 7 10:35:11 2013 +0100
settings: Never have nameless rows
When the name of the device isn't known yet, don't show a NULL
row, show the device type instead.
lib/bluetooth-settings-row.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/lib/bluetooth-settings-row.c b/lib/bluetooth-settings-row.c
index fa2fb89..c253f4d 100644
--- a/lib/bluetooth-settings-row.c
+++ b/lib/bluetooth-settings-row.c
@@ -28,6 +28,7 @@
#include "bluetooth-settings-row.h"
#include "bluetooth-enums.h"
+#include "bluetooth-utils.h"
#include "gnome-bluetooth-enum-types.h"
#define BLUETOOTH_SETTINGS_ROW_GET_PRIVATE(obj) \
@@ -208,6 +209,10 @@ bluetooth_settings_row_set_property (GObject *object,
break;
case PROP_TYPE:
priv->type = g_value_get_flags (value);
+ if (priv->name == NULL) {
+ gtk_label_set_text (GTK_LABEL (priv->label),
+ bluetooth_type_to_string (priv->type));
+ }
break;
case PROP_CONNECTED:
priv->connected = g_value_get_boolean (value);
@@ -216,7 +221,8 @@ bluetooth_settings_row_set_property (GObject *object,
case PROP_NAME:
g_free (priv->name);
priv->name = g_value_dup_string (value);
- gtk_label_set_text (GTK_LABEL (priv->label), priv->name);
+ if (priv->name != NULL)
+ gtk_label_set_text (GTK_LABEL (priv->label), priv->name);
break;
case PROP_ADDRESS:
g_free (priv->bdaddr);
@@ -271,7 +277,7 @@ bluetooth_settings_row_class_init (BluetoothSettingsRowClass *klass)
g_object_class_install_property (object_class, PROP_NAME,
g_param_spec_string ("name", NULL,
"Name",
- "Placeholder Name", G_PARAM_READWRITE));
+ NULL, G_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_ADDRESS,
g_param_spec_string ("address", NULL,
"Address",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]