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 228 by harbaum, Thu Dec 3 20:07:13 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);  #ifdef USE_STACKABLE_WINDOW
770      if(context->notes_have_been_changed) {
771        printf("notes changed -> cachelist redraw\n");
772    
773        /* now the cachelist is visible again. so redraw it since it may */
774        /* have changed */
775        cachelist_redraw(context->appdata);
776      }
777    #endif
778    
779      printf("freeing cache context\n");
780      context->appdata->cache_context = NULL;
781      g_free(context);
782  }  }
783    
784  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)
# Line 867  static GObject *notebook_object(GtkWidge Line 878  static GObject *notebook_object(GtkWidge
878  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {  GtkWidget *cache_view(appdata_t *appdata, cache_t *cache) {
879    GtkWidget *notebook;    GtkWidget *notebook;
880    
881    cache_context_t *cache_context = malloc(sizeof(cache_context_t));    cache_context_t *cache_context = g_new0(cache_context_t, 1);
882    memset(cache_context, 0, sizeof(cache_context_t));    appdata->cache_context = cache_context;
883    cache_context->appdata = appdata;    cache_context->appdata = appdata;
884    cache_context->cache = cache;    cache_context->cache = cache;
885    
# Line 946  void cache_dialog(appdata_t *appdata, ca Line 957  void cache_dialog(appdata_t *appdata, ca
957  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {
958    appdata->cur_cache = NULL;    appdata->cur_cache = NULL;
959    
960      HildonWindowStack *stack = hildon_window_stack_get_default();
961      appdata->window = HILDON_WINDOW(hildon_window_stack_peek(stack));
962    
963    /* restore cur_view */    /* restore cur_view */
964    appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view");    appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view");
965  }  }
966    
967  void cache_dialog(appdata_t *appdata, cache_t *cache) {  void cache_dialog(appdata_t *appdata, cache_t *cache) {
968    GtkWidget *window = hildon_stackable_window_new();    GtkWidget *window = hildon_stackable_window_new();
969      appdata->window = HILDON_WINDOW(window);
970    
971    /* store last "cur_view" in window */    /* store last "cur_view" in window */
972    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.228