r3452 - in trunk/src/target/OM-2007.2/applications/openmoko-dialer2: . src/phone-kit

chris at sita.openmoko.org chris at sita.openmoko.org
Tue Nov 20 12:31:26 CET 2007


Author: chris
Date: 2007-11-20 12:31:24 +0100 (Tue, 20 Nov 2007)
New Revision: 3452

Modified:
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
   trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer-sms.c
Log:
        * src/phone-kit/moko-dialer-sms.c: (opened_cb), (moko_dialer_sms_init):
        Don't forget to open the note store before trying to do anything


Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-11-20 09:10:06 UTC (rev 3451)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog	2007-11-20 11:31:24 UTC (rev 3452)
@@ -1,5 +1,10 @@
 2007-11-19  Chris Lord  <chris at openedhand.com>
 
+	* src/phone-kit/moko-dialer-sms.c: (opened_cb), (moko_dialer_sms_init):
+	Don't forget to open the note store before trying to do anything
+
+2007-11-19  Chris Lord  <chris at openedhand.com>
+
 	* src/phone-kit/moko-dialer-sms.c: (moko_dialer_sms_finalize),
 	(connection_source_prepare), (connection_source_check),
 	(connection_source_dispatch), (moko_dialer_sms_init):

Modified: trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer-sms.c
===================================================================
--- trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer-sms.c	2007-11-20 09:10:06 UTC (rev 3451)
+++ trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/phone-kit/moko-dialer-sms.c	2007-11-20 11:31:24 UTC (rev 3452)
@@ -318,9 +318,8 @@
 }
 
 static void
-moko_dialer_sms_init (MokoDialerSMS *self)
+opened_cb (JanaStore *store, MokoDialerSMS *self)
 {
-	static gboolean first_init = TRUE;
 	static GSourceFuncs funcs = {
 		connection_source_prepare,
 		connection_source_check,
@@ -330,20 +329,13 @@
 	
 	MokoDialerSMSPrivate *priv = SMS_PRIVATE (self);
 	
-	/* We can only have one of these objects per process, as the gsmd 
-	 * event handling callback does not allow for custom data...
-	 */
-	if (!first_init)
-		g_error ("MokoDialerSMS already created in this process");
-	first_init = FALSE;
-	
-	/* Get the note store */
-	priv->note_store = jana_ecal_store_new (JANA_COMPONENT_NOTE);
-	
+	g_debug ("Journal opened, connecting to gsmd");
+
 	/* Initialise gsmd and connect event handler */
 	if (!(priv->handle = lgsm_init (LGSMD_DEVICE_GSMD))) {
 		g_error ("Failed to connect to gsmd");
 	} else {
+		g_debug ("Connected to gsmd");
 		lgsm_evt_handler_register (priv->handle, GSMD_EVT_IN_SMS,
 			gsmd_eventhandler);
 		lgsm_evt_handler_register (priv->handle, GSMD_EVT_IN_DS,
@@ -367,6 +359,27 @@
 	g_source_attach ((GSource*)priv->source, NULL);
 }
 
+static void
+moko_dialer_sms_init (MokoDialerSMS *self)
+{
+	static gboolean first_init = TRUE;
+	
+	MokoDialerSMSPrivate *priv = SMS_PRIVATE (self);
+	
+	/* We can only have one of these objects per process, as the gsmd 
+	 * event handling callback does not allow for custom data...
+	 */
+	if (!first_init)
+		g_error ("MokoDialerSMS already created in this process");
+	first_init = FALSE;
+	
+	/* Get the note store */
+	priv->note_store = jana_ecal_store_new (JANA_COMPONENT_NOTE);
+	g_signal_connect (priv->note_store, "opened",
+		G_CALLBACK (opened_cb), self);
+	jana_store_open (priv->note_store);
+}
+
 MokoDialerSMS*
 moko_dialer_sms_new (void)
 {





More information about the commitlog mailing list