More GObject* fun

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2014-11-25 13:57:02 +01:00
parent 9dc02b6425
commit 10f3da57c6
3 changed files with 12 additions and 10 deletions

View file

@ -79,9 +79,10 @@ update_visible_pages(zathura_t* zathura)
/* reset current search result */
girara_list_t* results = NULL;
g_object_get(page_widget, "search-results", &results, NULL);
GObject* obj_page_widget = G_OBJECT(page_widget);
g_object_get(obj_page_widget, "search-results", &results, NULL);
if (results != NULL) {
g_object_set(page_widget, "search-current", 0, NULL);
g_object_set(obj_page_widget, "search-current", 0, NULL);
}
}
}
@ -264,7 +265,7 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
GtkTreeModel *model;
GtkTreeIter iter;
g_object_get(tree_view, "model", &model, NULL);
g_object_get(G_OBJECT(tree_view), "model", &model, NULL);
if(gtk_tree_model_get_iter(model, &iter, path)) {
zathura_index_element_t* index_element;
@ -322,7 +323,7 @@ handle_link(GtkEntry* entry, girara_session_t* session,
}
GtkWidget* page_widget = zathura_page_get_widget(zathura, page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
g_object_set(G_OBJECT(page_widget), "draw-links", FALSE, NULL);
if (eval == true) {
zathura_link_t* link = zathura_page_widget_link_get(ZATHURA_PAGE(page_widget), index);

View file

@ -373,7 +373,8 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
GtkWidget* page_widget = zathura_page_get_widget(zathura, page);
g_object_set(page_widget, "draw-links", FALSE, NULL);
GObject* obj_page_widget = G_OBJECT(page_widget);
g_object_set(obj_page_widget, "draw-links", FALSE, NULL);
zathura_renderer_lock(zathura->sync.render_thread);
girara_list_t* result = zathura_page_search_text(page, input, &error);
@ -381,7 +382,7 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
if (result == NULL || girara_list_size(result) == 0) {
girara_list_free(result);
g_object_set(page_widget, "search-results", NULL, NULL);
g_object_set(obj_page_widget, "search-results", NULL, NULL);
if (error == ZATHURA_ERROR_NOT_IMPLEMENTED) {
break;
@ -390,13 +391,13 @@ cmd_search(girara_session_t* session, const char* input, girara_argument_t* argu
}
}
g_object_set(page_widget, "search-results", result, NULL);
g_object_set(obj_page_widget, "search-results", result, NULL);
if (argument->n == BACKWARD) {
/* start at bottom hit in page */
g_object_set(page_widget, "search-current", girara_list_size(result) - 1, NULL);
g_object_set(obj_page_widget, "search-current", girara_list_size(result) - 1, NULL);
} else {
g_object_set(page_widget, "search-current", 0, NULL);
g_object_set(obj_page_widget, "search-current", 0, NULL);
}
}

View file

@ -228,7 +228,7 @@ zathura_init(zathura_t* zathura)
if (zathura->database == NULL && g_strcmp0(database, "null") != 0) {
girara_error("Unable to initialize database. Bookmarks won't be available.");
} else {
g_object_set(zathura->ui.session->command_history, "io", zathura->database, NULL);
g_object_set(G_OBJECT(zathura->ui.session->command_history), "io", zathura->database, NULL);
}
/* bookmarks */