path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store),
&iter);
- page = gtk_tree_path_get_indices (path)[0] + 1;
+ page = gtk_tree_path_get_indices (path)[0];
gtk_tree_path_free (path);
page_cache = ev_document_get_page_cache (priv->document);
GtkTreePath *path;
GtkTreeSelection *selection;
- path = gtk_tree_path_new_from_indices (page - 1, -1);
+ path = gtk_tree_path_new_from_indices (page, -1);
selection = gtk_tree_view_get_selection
(GTK_TREE_VIEW (sidebar->priv->tree_view));
GdkPixbuf *loading_icon;
gint i, n_pages;
GtkTreeIter iter;
- gchar *page;
gint width = THUMBNAIL_WIDTH;
gint height = THUMBNAIL_WIDTH;
EvPageCache *page_cache;
loading_icon = ev_document_misc_get_thumbnail_frame (width, height, NULL);
gtk_list_store_clear (priv->list_store);
- for (i = 1; i <= n_pages; i++) {
+ for (i = 0; i < n_pages; i++) {
EvJob *job;
+ gchar *page_label;
+ gchar *page_string;
+
+ job = ev_job_thumbnail_new (priv->document, i, THUMBNAIL_WIDTH);
+ page_label = ev_page_cache_get_page_label (page_cache, i);
+ page_string = g_markup_printf_escaped ("<i>%s</i>", page_label);
- /* FIXME: Bah. This is still -1 for some reason. Need to track it down.. */
- job = ev_job_thumbnail_new (priv->document, i - 1, THUMBNAIL_WIDTH);
- page = g_strdup_printf ("<i>%d</i>", i);
gtk_list_store_append (priv->list_store, &iter);
gtk_list_store_set (priv->list_store, &iter,
- COLUMN_PAGE_STRING, page,
+ COLUMN_PAGE_STRING, page_string,
COLUMN_PIXBUF, loading_icon,
COLUMN_THUMBNAIL_SET, FALSE,
COLUMN_JOB, job,
-1);
- g_free (page);
+ g_free (page_label);
+ g_free (page_string);
ev_job_queue_add_job (job, EV_JOB_PRIORITY_LOW);
g_object_set_data_full (G_OBJECT (job), "tree_iter",
gtk_tree_iter_copy (&iter),