[gnumeric] Hyperlinks: fix deprecations and leaks.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Hyperlinks: fix deprecations and leaks.
- Date: Fri, 2 Jan 2015 00:50:50 +0000 (UTC)
commit dbc424c90a2dee863afdbdfb7238a3edc690f401
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 1 19:49:32 2015 -0500
Hyperlinks: fix deprecations and leaks.
src/dialogs/ChangeLog | 3 +++
src/dialogs/dialog-hyperlink.c | 18 ++++++++++--------
2 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 9100d18..7b7a0f7 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,8 @@
2015-01-01 Morten Welinder <terra gnome org>
+ * dialog-hyperlink.c (dhl_setup_type): Fix deprecations.
+ (dhl_init): Plug leak.
+
* dialog-cell-format.c (build_validation_error_combo): Plug leak.
(cb_validation_error_action_changed): Fix deprecations.
diff --git a/src/dialogs/dialog-hyperlink.c b/src/dialogs/dialog-hyperlink.c
index 4e7011a..037df32 100644
--- a/src/dialogs/dialog-hyperlink.c
+++ b/src/dialogs/dialog-hyperlink.c
@@ -296,13 +296,13 @@ dhl_get_target_url (HyperlinkState *state, gboolean *success)
static struct {
char const *label;
- char const *image_name;
+ char const *icon_name;
char const *name;
char const *widget_name;
char const *descriptor;
void (*set_target) (HyperlinkState *state, const char* const target);
char * (*get_target) (HyperlinkState *state, gboolean *success);
-} const type [] = {
+} const type[] = {
{ N_("Internal Link"), "gnumeric-link-internal",
"GnmHLinkCurWB", "internal-link-grid",
N_("Jump to specific cells or named range in the current workbook"),
@@ -429,9 +429,9 @@ dhl_setup_type (HyperlinkState *state)
if (!strcmp (name, type[i].name)) {
gtk_widget_show_all (w);
- gtk_image_set_from_stock
- (state->type_image, type[i].image_name,
- GTK_ICON_SIZE_LARGE_TOOLBAR);
+ gtk_image_set_from_icon_name
+ (state->type_image, type[i].icon_name,
+ GTK_ICON_SIZE_DIALOG);
gtk_label_set_text (state->type_descriptor,
_(type[i].descriptor));
} else
@@ -476,10 +476,11 @@ dhl_init (HyperlinkState *state)
GtkSizeGroup *size_group;
GnmExprEntry *expr_entry;
unsigned i, select = 0;
- GdkPixbuf *pixbuf;
GtkListStore *store;
GtkTreeIter iter;
GtkCellRenderer *renderer;
+ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wbcg_toplevel (state->wbcg)));
+ GtkIconTheme *theme = gtk_icon_theme_get_for_screen (screen);
#ifdef GNM_NO_MAILTO
gtk_widget_hide (go_gtk_builder_get_widget (state->gui, "email-grid"));
@@ -524,13 +525,14 @@ dhl_init (HyperlinkState *state)
g_object_unref (store);
for (i = 0 ; i < G_N_ELEMENTS (type); i++) {
- pixbuf = gtk_widget_render_icon_pixbuf (w, type[i].image_name,
- GTK_ICON_SIZE_MENU);
+ GdkPixbuf *pixbuf =
+ gtk_icon_theme_load_icon (theme, type[i].icon_name, 16, 0, NULL);
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
0, pixbuf,
1, _(type[i].label),
-1);
+ g_object_unref (pixbuf);
if (strcmp (G_OBJECT_TYPE_NAME (state->link),
type [i].name) == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]