Diff of /trunk/src/cache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 214 by harbaum, Thu Nov 26 10:05:23 2009 UTC revision 226 by harbaum, Wed Dec 2 20:05:52 2009 UTC
# Line 83  void overview_coordinate_update(cache_co Line 83  void overview_coordinate_update(cache_co
83    
84    /* update position labels */    /* update position labels */
85    int strike = notes_get_override(context)?STRIKETHROUGH:STRIKETHROUGH_NONE;    int strike = notes_get_override(context)?STRIKETHROUGH:STRIKETHROUGH_NONE;
86    char str[32];    lat_label_attrib_set(context->pos_lat_label,
87    pos_lat_str(str, sizeof(str), context->cache->pos.lat);                         context->cache->pos.lat, SIZE_BIG, strike);
88    gtk_label_attrib_set(context->pos_lat_label, str, SIZE_BIG, strike);    lon_label_attrib_set(context->pos_lon_label,
89    pos_lon_str(str, sizeof(str), context->cache->pos.lon);                         context->cache->pos.lon, SIZE_BIG, strike);
   gtk_label_attrib_set(context->pos_lon_label, str, SIZE_BIG, strike);  
90    
91    /* remove enire hbox and build a new one */    /* remove enire hbox and build a new one */
92    gtk_container_foreach(GTK_CONTAINER(context->bearing_hbox),    gtk_container_foreach(GTK_CONTAINER(context->bearing_hbox),
# Line 767  static void on_notebook_destroy(GtkWidge Line 766  static void on_notebook_destroy(GtkWidge
766      gtk_timeout_remove(context->handler_id);      gtk_timeout_remove(context->handler_id);
767  #endif  #endif
768    
769    free(user_data);    printf("freeing cache context\n");
770      g_free(context);
771  }  }
772    
773  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)
# Line 867  static GObject *notebook_object(GtkWidge Line 867  static GObject *notebook_object(GtkWidge
867  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {
868    GtkWidget *notebook;    GtkWidget *notebook;
869    
870    cache_context_t *cache_context = malloc(sizeof(cache_context_t));    cache_context_t *cache_context = g_new0(cache_context_t, 1);
   memset(cache_context, 0, sizeof(cache_context_t));  
871    cache_context->appdata = appdata;    cache_context->appdata = appdata;
872    cache_context->cache = cache;    cache_context->cache = cache;
873    
# Line 946  void cache_dialog(appdata_t *appdata, ca Line 945  void cache_dialog(appdata_t *appdata, ca
945  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {
946    appdata->cur_cache = NULL;    appdata->cur_cache = NULL;
947    
948      HildonWindowStack *stack = hildon_window_stack_get_default();
949      appdata->window = HILDON_WINDOW(hildon_window_stack_peek(stack));
950    
951    /* restore cur_view */    /* restore cur_view */
952    appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view");    appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view");
953  }  }
954    
955  void cache_dialog(appdata_t *appdata, cache_t *cache) {  void cache_dialog(appdata_t *appdata, cache_t *cache) {
956    GtkWidget *window = hildon_stackable_window_new();    GtkWidget *window = hildon_stackable_window_new();
957      appdata->window = HILDON_WINDOW(window);
958    
959    /* store last "cur_view" in window */    /* store last "cur_view" in window */
960    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);

Legend:
Removed from v.214  
changed lines
  Added in v.226