[maemo-commits] [maemo-commits] r19353 - in projects/haf/trunk/hildon-input-method-plugins-example: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Sep 15 15:40:56 EEST 2009
Author: jrocha
Date: 2009-09-15 15:40:53 +0300 (Tue, 15 Sep 2009)
New Revision: 19353

Modified:
   projects/haf/trunk/hildon-input-method-plugins-example/ChangeLog
   projects/haf/trunk/hildon-input-method-plugins-example/src/hildon-im-onehand-fkb.c
Log:
2009-09-15  Joaquim Rocha <jrocha at igalia.com>

    * hildon-im-onehand-fkb.c: Replaced repeated strings by defines.

Modified: projects/haf/trunk/hildon-input-method-plugins-example/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-input-method-plugins-example/ChangeLog	2009-09-15 11:11:55 UTC (rev 19352)
+++ projects/haf/trunk/hildon-input-method-plugins-example/ChangeLog	2009-09-15 12:40:53 UTC (rev 19353)
@@ -7,7 +7,8 @@
 	  to the midle of the button so it looks better; Added "persistent_value"
 	  data to each created key.
 	* hildon-im-onehand-fkb.c: Added persisten press mode (press a button 
-	  until a value is inserted) to input the "persistent_value" text.
+	  until a value is inserted) to input the "persistent_value" text; Replaced
+	  repeated strings by defines.
 
 2009-09-10  Murray Cumming  <murrayc at murrayc.com>
 

Modified: projects/haf/trunk/hildon-input-method-plugins-example/src/hildon-im-onehand-fkb.c
===================================================================
--- projects/haf/trunk/hildon-input-method-plugins-example/src/hildon-im-onehand-fkb.c	2009-09-15 11:11:55 UTC (rev 19352)
+++ projects/haf/trunk/hildon-input-method-plugins-example/src/hildon-im-onehand-fkb.c	2009-09-15 12:40:53 UTC (rev 19353)
@@ -33,6 +33,8 @@
 
 #define SLIDING_TIMEOUT 1000
 #define FAVORITE_HAND RIGHT
+#define KEYS_VALUES_DATA "key_values"
+#define PERSISTENT_VALUE_DATA "persistent_value"
 
 #define MCE_RULE "type='signal', interface='" MCE_SIGNAL_IF "', member='" MCE_DEVICE_ORIENTATION_SIG "'"
 #define MCE_PORTRAIT_MODE_NAME "portrait"
@@ -753,12 +755,12 @@
   priv->repeating_key = NULL;
 
   const gchar *text = g_strdup (g_object_get_data (G_OBJECT (priv->pressed_key),
-                                                   "persistent_value"));
+                                                   PERSISTENT_VALUE_DATA));
 
   if (text == NULL)
   {
     gchar *key_values = g_object_get_data (G_OBJECT (priv->pressed_key),
-                                           "key_values");
+                                           KEYS_VALUES_DATA);
     text = g_strdup (get_first_char (key_values));
   }
 
@@ -817,7 +819,7 @@
 
   caps_on = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->caps_button));
 
-  key_value = g_object_get_data (G_OBJECT (key), "key_values");
+  key_value = g_object_get_data (G_OBJECT (key), KEYS_VALUES_DATA);
   nr_values = g_utf8_strlen (key_value, -1);
 
   if (nr_values <= 1)
@@ -869,8 +871,8 @@
   GtkWidget *key = hildon_button_new (HILDON_SIZE_THUMB_HEIGHT,
                                       HILDON_BUTTON_ARRANGEMENT_VERTICAL);
 
-  g_object_set_data (G_OBJECT (key), "key_values", key_values);
-  g_object_set_data (G_OBJECT (key), "persistent_value", title);
+  g_object_set_data (G_OBJECT (key), KEYS_VALUES_DATA, key_values);
+  g_object_set_data (G_OBJECT (key), PERSISTENT_VALUE_DATA, title);
 
   if (visible_offset > 0)
   {

More information about the maemo-commits mailing list