From 1a52ee76c28766d3926dfa23a3981df2d6c3794f Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 24 Jul 2007 16:54:32 +0000 Subject: [PATCH] 2007-07-24 Murray Cumming * src/maemo/modest-maemo-global-settings-dialog.c: (current_connection): Avoid a crash (probably only in scratchbox) when strcmp()ing a NULL when closing the dialog. pmo-trunk-r2787 --- ChangeLog2 | 7 +++++++ src/dbus_api/modest-dbus-callbacks.c | 1 + src/maemo/modest-maemo-global-settings-dialog.c | 18 ++++++++++-------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/ChangeLog2 b/ChangeLog2 index f1f59b0..054e8cd 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,12 @@ 2007-07-24 Murray Cumming + * src/maemo/modest-maemo-global-settings-dialog.c: + (current_connection): + Avoid a crash (probably only in scratchbox) when strcmp()ing a + NULL when closing the dialog. + +2007-07-24 Murray Cumming + * src/dbus_api/modest-dbus-callbacks.c: (on_idle_delete_message): Remove the hacky send/receive that didn't work, and instead refilter the treemodel to make the deleted email really vanish from diff --git a/src/dbus_api/modest-dbus-callbacks.c b/src/dbus_api/modest-dbus-callbacks.c index c0cfc11..2f39ffb 100644 --- a/src/dbus_api/modest-dbus-callbacks.c +++ b/src/dbus_api/modest-dbus-callbacks.c @@ -816,6 +816,7 @@ on_idle_send_receive(gpointer user_data) static gint on_send_receive(GArray * arguments, gpointer data, osso_rpc_t * retval) { + printf("DEBUG: modest: %s\n", __FUNCTION__); /* Use g_idle to context-switch into the application's thread: */ /* This method has no arguments. */ diff --git a/src/maemo/modest-maemo-global-settings-dialog.c b/src/maemo/modest-maemo-global-settings-dialog.c index 1857c72..b44f141 100644 --- a/src/maemo/modest-maemo-global-settings-dialog.c +++ b/src/maemo/modest-maemo-global-settings-dialog.c @@ -478,8 +478,8 @@ on_range_error (HildonNumberEditor *editor, static ModestConnectedVia current_connection (void) { - TnyAccountStore *account_store; - TnyDevice *device; + TnyAccountStore *account_store = NULL; + TnyDevice *device = NULL; ModestConnectedVia retval = MODEST_CONNECTED_VIA_ANY; account_store = TNY_ACCOUNT_STORE (modest_runtime_get_account_store ()); @@ -494,15 +494,17 @@ current_connection (void) ConIcIap *iap = tny_maemo_conic_device_get_iap ( TNY_MAEMO_CONIC_DEVICE (device), iap_id); const gchar *bearer_type = con_ic_iap_get_bearer_type (iap); - - if (!strcmp (bearer_type, CON_IC_BEARER_WLAN_INFRA) || - !strcmp (bearer_type, CON_IC_BEARER_WLAN_ADHOC)) - retval = MODEST_CONNECTED_VIA_WLAN; - else - retval = MODEST_CONNECTED_VIA_ANY; + if (bearer_type) { + if (!strcmp (bearer_type, CON_IC_BEARER_WLAN_INFRA) || + !strcmp (bearer_type, CON_IC_BEARER_WLAN_ADHOC)) + retval = MODEST_CONNECTED_VIA_WLAN; + else + retval = MODEST_CONNECTED_VIA_ANY; + } g_object_unref (iap); } + g_object_unref (device); return retval; -- 1.7.9.5