Changeset 7a5ba755e957d3211036ab6f128ef38a898a870d

Show
Ignore:
Timestamp:
09/03/10 01:49:11 (3 years ago)
Author:
Nedko Arnaudov <nedko@…>
Children:
f4c002c584f0542ec4c63c0b90f6cad811d62fc0
Parents:
6dbf026ba23078d0b544fecc30aa1f4bf9486690
git-committer:
Nedko Arnaudov <nedko@arnaudov.name> / 2010-09-03T01:49:11Z+0300
Message:

Add app list version number to the AppStateChanged? signal and check it

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • daemon/app_supervisor.c

    r5374af8 r7a5ba75  
    158158  terminal = app_ptr->terminal; 
    159159 
     160  supervisor_ptr->version++; 
     161 
    160162  dbus_signal_emit( 
    161163    g_dbus_connection, 
     
    163165    IFACE_APP_SUPERVISOR, 
    164166    "AppStateChanged", 
    165     "tsbby", 
     167    "ttsbby", 
     168    &supervisor_ptr->version, 
    166169    &app_ptr->id, 
    167170    &app_ptr->name, 
     
    10791082 
    10801083SIGNAL_ARGS_BEGIN(AppStateChanged, "") 
     1084  SIGNAL_ARG_DESCRIBE("new_list_version", DBUS_TYPE_UINT64_AS_STRING, "") 
    10811085  SIGNAL_ARG_DESCRIBE("id", DBUS_TYPE_UINT64_AS_STRING, "") 
    10821086  SIGNAL_ARG_DESCRIBE("name", DBUS_TYPE_STRING_AS_STRING, "") 
  • proxies/app_supervisor_proxy.c

    r40e2448 r7a5ba75  
    109109static void on_app_state_changed(void * context, DBusMessage * message_ptr) 
    110110{ 
     111  uint64_t new_list_version; 
    111112  uint64_t id; 
    112113  const char * name; 
     
    118119        message_ptr, 
    119120        &g_dbus_error, 
     121        DBUS_TYPE_UINT64, &new_list_version, 
    120122        DBUS_TYPE_UINT64, &id, 
    121123        DBUS_TYPE_STRING, &name, 
     
    131133 
    132134  //log_info("AppStateChanged signal received"); 
    133   proxy_ptr->app_state_changed(proxy_ptr->context, id, name, running, terminal, level); 
     135  //log_info("AppRemoved signal received, id=%"PRIu64, id); 
     136  if (new_list_version <= proxy_ptr->version) 
     137  { 
     138    log_info("Ignoring signal for older version of the app list"); 
     139  } 
     140  else 
     141  { 
     142    proxy_ptr->app_state_changed(proxy_ptr->context, id, name, running, terminal, level); 
     143  } 
    134144} 
    135145