"screen",
g_variant_new_int32 (gdk_screen_get_number (data->screen)));
if (data->dest) {
- g_variant_builder_add (&builder, "{sv}",
- "page-label",
- g_variant_new_string (ev_link_dest_get_page_label (data->dest)));
+ const gchar *page_label = ev_link_dest_get_page_label (data->dest);
+
+ if (page_label) {
+ g_variant_builder_add (&builder, "{sv}",
+ "page-label",
+ g_variant_new_string (page_label));
+ } else {
+ g_variant_builder_add (&builder, "{sv}",
+ "page-index",
+ g_variant_new_uint32 (ev_link_dest_get_page (data->dest)));
+ }
}
if (data->search_string) {
g_variant_builder_add (&builder, "{sv}",
mode = g_variant_get_uint32 (value);
} else if (strcmp (key, "page-label") == 0 && g_variant_classify (value) == G_VARIANT_CLASS_STRING) {
dest = ev_link_dest_new_page_label (g_variant_get_string (value, NULL));
+ } else if (strcmp (key, "page-index") == 0 && g_variant_classify (value) == G_VARIANT_CLASS_UINT32) {
+ dest = ev_link_dest_new_page (g_variant_get_uint32 (value));
} else if (strcmp (key, "find-string") == 0 && g_variant_classify (value) == G_VARIANT_CLASS_STRING) {
search_string = g_variant_get_string (value, NULL);
}