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 221 by harbaum, Mon Nov 30 21:28:04 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 746  static void on_notebook_page_change(GtkN Line 745  static void on_notebook_page_change(GtkN
745      /* striked out coordinate may need update */      /* striked out coordinate may need update */
746      overview_coordinate_update(context);      overview_coordinate_update(context);
747    }    }
748    
749      if(strcasecmp(name, _("Goto")) == 0) {
750        /* redo coo_button since state of overwritten coordinate may have changed */
751        preset_coordinate_picker_update(context->appdata, context->gotoc.coo_popup);
752      }
753  }  }
754    
755  static void on_notebook_destroy(GtkWidget *widget, gpointer user_data ) {  static void on_notebook_destroy(GtkWidget *widget, gpointer user_data ) {
# Line 767  static void on_notebook_destroy(GtkWidge Line 771  static void on_notebook_destroy(GtkWidge
771      gtk_timeout_remove(context->handler_id);      gtk_timeout_remove(context->handler_id);
772  #endif  #endif
773    
774    free(user_data);    printf("freeing cache context\n");
775      g_free(context);
776  }  }
777    
778  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)
# Line 867  static GObject *notebook_object(GtkWidge Line 872  static GObject *notebook_object(GtkWidge
872  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {
873    GtkWidget *notebook;    GtkWidget *notebook;
874    
875    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));  
876    cache_context->appdata = appdata;    cache_context->appdata = appdata;
877    cache_context->cache = cache;    cache_context->cache = cache;
878    

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