typedef struct _EvPageCacheData {
EvJob *job;
gboolean done : 1;
+ gboolean dirty : 1;
EvJobPageDataFlags flags;
EvMappingList *link_mapping;
{
EvJobPageDataFlags flags = EV_PAGE_DATA_INCLUDE_NONE;
- if (data->flags == cache->flags)
+ if (data->flags == cache->flags && !data->dirty)
return cache->flags;
- /* Flags changed */
+ /* Flags changed or data is dirty */
if (cache->flags & EV_PAGE_DATA_INCLUDE_LINKS) {
flags = (data->link_mapping) ?
flags & ~EV_PAGE_DATA_INCLUDE_LINKS :
if (job_data->flags & EV_PAGE_DATA_INCLUDE_TEXT)
data->text = job_data->text;
data->done = TRUE;
+ data->dirty = FALSE;
g_object_unref (data->job);
data->job = NULL;
EvPageCacheData *data = &cache->page_list[i];
EvJobPageDataFlags flags;
- if (data->flags == cache->flags && (data->done || data->job))
+ if (data->flags == cache->flags && !data->dirty && (data->done || data->job))
continue;
if (data->job)
ev_page_cache_set_page_range (cache, cache->start_page, cache->end_page);
}
+void
+ev_page_cache_mark_dirty (EvPageCache *cache,
+ gint page)
+{
+ EvPageCacheData *data;
+
+ g_return_if_fail (EV_IS_PAGE_CACHE (cache));
+
+ data = &cache->page_list[page];
+ data->dirty = TRUE;
+
+ /* Update the current range */
+ ev_page_cache_set_page_range (cache, cache->start_page, cache->end_page);
+}
+
EvMappingList *
ev_page_cache_get_link_mapping (EvPageCache *cache,
gint page)
EvJobPageDataFlags ev_page_cache_get_flags (EvPageCache *cache);
void ev_page_cache_set_flags (EvPageCache *cache,
EvJobPageDataFlags flags);
+void ev_page_cache_mark_dirty (EvPageCache *cache,
+ gint page);
EvMappingList *ev_page_cache_get_link_mapping (EvPageCache *cache,
gint page);
EvMappingList *ev_page_cache_get_image_mapping (EvPageCache *cache,