[file-roller] removed use of deprecated functions
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] removed use of deprecated functions
- Date: Sun, 28 Apr 2013 07:48:51 +0000 (UTC)
commit 18c95231668d34ccf48f89e3bbc71856a7187d6c
Author: Paolo Bacchilega <paobac src gnome org>
Date: Sun Apr 28 09:38:26 2013 +0200
removed use of deprecated functions
src/fr-file-selector-dialog.c | 16 ++++++++++------
src/glib-utils.c | 4 ++++
src/gtk-utils.c | 2 +-
src/main.c | 2 --
src/test-server.c | 2 --
5 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/src/fr-file-selector-dialog.c b/src/fr-file-selector-dialog.c
index 9c4700a..7760c42 100644
--- a/src/fr-file-selector-dialog.c
+++ b/src/fr-file-selector-dialog.c
@@ -686,15 +686,18 @@ update_places_list (FrFileSelectorDialog *self)
/* Taken from the Gtk+ file gtkfilechooserdefault.c
* Copyright (C) 2003, Red Hat, Inc.
*
+ * Changed by File-Roller authors
+ *
* Guesses a size based upon font sizes */
static int
get_font_size (GtkWidget *widget)
{
- GtkStyleContext *context;
- GtkStateFlags state;
- int font_size;
- GdkScreen *screen;
- double resolution;
+ GtkStyleContext *context;
+ GtkStateFlags state;
+ int font_size;
+ GdkScreen *screen;
+ double resolution;
+ PangoFontDescription *font;
context = gtk_widget_get_style_context (widget);
state = gtk_widget_get_state_flags (widget);
@@ -708,7 +711,8 @@ get_font_size (GtkWidget *widget)
else
resolution = 96.0; /* wheeee */
- font_size = pango_font_description_get_size (gtk_style_context_get_font (context, state));
+ gtk_style_context_get (context, state, "font", &font, NULL);
+ font_size = pango_font_description_get_size (font);
font_size = PANGO_PIXELS (font_size) * resolution / 72.0;
return font_size;
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 9fb222e..25f3f34 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -19,6 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>
@@ -27,6 +28,9 @@
#include <glib/gprintf.h>
#include <glib-object.h>
#include "glib-utils.h"
+#if ENABLE_MAGIC
+# include <magic.h>
+#endif
#define MAX_PATTERNS 128
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index b839e69..9df2b5b 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -511,7 +511,7 @@ _g_icon_get_pixbuf (GIcon *icon,
g_error_free (error);
}
- gtk_icon_info_free (icon_info);
+ g_object_unref (icon_info);
}
return pixbuf;
diff --git a/src/main.c b/src/main.c
index a43ecd5..043f604 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,8 +30,6 @@ main (int argc, char **argv)
GtkApplication *app;
int status;
- g_type_init ();
-
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
diff --git a/src/test-server.c b/src/test-server.c
index 79c020a..d3103b2 100644
--- a/src/test-server.c
+++ b/src/test-server.c
@@ -135,8 +135,6 @@ main (int argc, char *argv[])
GDBusConnection *connection;
GError *error = NULL;
- g_type_init ();
-
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (connection != NULL) {
GDBusProxy *proxy;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]