Changeset 3021

Show
Ignore:
Timestamp:
11/28/07 17:14:02
Author:
svillar
Message:
  • Fixed a bug when creating the device
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r3017 r3021  
    33        * libtinymail-maemo/tny-maemo-conic-dummy-device.c 
    44        Fixed a g_signal_connect which was receiving an invalid user_data 
     5        The device now gets the connection status correctly when it's created 
     6        and no longer reports false connection status changes after 1 second 
    57 
    682007-11-26 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> 
  • trunk/libtinymail-maemo/tny-maemo-conic-dummy-device.c

    r3017 r3021  
    297297        GError* error = NULL; 
    298298        gboolean test = FALSE; 
     299        static gboolean first_time = TRUE; 
    299300                 
    300301        self = TNY_MAEMO_CONIC_DEVICE (user_data); 
     
    334335                if (strcmp (priv->iap, MAEMO_CONIC_DUMMY_IAP_ID_NONE) == 0) { 
    335336                        priv->is_online = FALSE; 
    336                         g_debug ("DEBUG: TnyMaemoConicDevice: %s:\n  Dummy connection changed to no connection.\n", __FUNCTION__); 
    337337                } else { 
    338338                        priv->is_online = TRUE; 
    339                         g_debug ("DEBUG: TnyMaemoConicDevice: %s:\n  Dummy connection changed to '%s\n", __FUNCTION__, priv->iap); 
    340339                } 
    341                  
    342                 g_debug ("DEBUG1: %s: emitting is_online=%d\n", __FUNCTION__, priv->is_online); 
    343  
    344                 conic_emit_status (TNY_DEVICE (self), priv->is_online); 
    345  
     340 
     341                /* Do not need to emit it the first time because it's 
     342                   called from the instance init */ 
     343                if (!first_time)                 
     344                        conic_emit_status (TNY_DEVICE (self), priv->is_online); 
     345                else 
     346                        first_time = FALSE; 
    346347        } 
    347348         
     
    539540        priv->is_online = dnsmasq_has_resolv (); 
    540541 
     542        /* Check if we're online right now */ 
     543        on_dummy_connection_check (self); 
     544 
    541545        /* Allow debuggers to fake a connection change by setting an environment  
    542546         * variable, which we check ever 1 second. This should match one of the  
    543547         * fake iap IDs that we created in tny_maemo_conic_device_get_iap_list().*/ 
    544  
    545         priv->dummy_env_check_timeout =  
     548        priv->dummy_env_check_timeout = 
    546549                g_timeout_add (1000, on_dummy_connection_check, self); 
    547550