[poppler] glib/demo

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Mon Jun 14 08:42:54 PDT 2010


 glib/demo/attachments.c |    5 -----
 glib/demo/main.c        |   32 +-------------------------------
 2 files changed, 1 insertion(+), 36 deletions(-)

New commits:
commit 34b2dbb6bbaf0189c92eea6b7924999ab2b6ad11
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Mon Jun 14 17:41:51 2010 +0200

    [glib-demo] Remove GLIB_CHECK_VERSION(), we already depend on glib 2.18

diff --git a/glib/demo/attachments.c b/glib/demo/attachments.c
index 28eb62e..63565dd 100644
--- a/glib/demo/attachments.c
+++ b/glib/demo/attachments.c
@@ -179,7 +179,6 @@ pgd_attachments_save_button_clicked (GtkButton   *button,
 		
 }
 
-#if GLIB_CHECK_VERSION(2, 16, 0)
 static gboolean
 attachment_save_callback (const gchar  *buf,
 			  gsize         count,
@@ -270,7 +269,6 @@ pgd_attachments_validate_button_clicked (GtkButton   *button,
 	g_free (digest);
 	g_object_unref (attachment);
 }
-#endif
 
 GtkWidget *
 pgd_attachments_create_widget (PopplerDocument *document)
@@ -340,7 +338,6 @@ pgd_attachments_create_widget (PopplerDocument *document)
 	gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
 	gtk_widget_show (button);
 
-#if GLIB_CHECK_VERSION(2, 16, 0)
 	button = gtk_button_new_with_label ("Validate");
 	g_signal_connect (G_OBJECT (button), "clicked",
 			  G_CALLBACK (pgd_attachments_validate_button_clicked),
@@ -348,8 +345,6 @@ pgd_attachments_create_widget (PopplerDocument *document)
 
 	gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
 	gtk_widget_show (button);
-#endif
-	
 
 	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 6);
 	gtk_widget_show (hbox);
diff --git a/glib/demo/main.c b/glib/demo/main.c
index 89e4eeb..9137a25 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -149,6 +149,7 @@ gint main (gint argc, gchar **argv)
 	GtkWidget        *notebook;
 	GtkWidget        *treeview;
 	GtkTreeSelection *selection;
+	GFile            *file;
 	gchar            *uri;
 	GTimer           *timer;
 	GError           *error = NULL;
@@ -163,40 +164,9 @@ gint main (gint argc, gchar **argv)
 
 	gtk_init (&argc, &argv);
 
-#if GLIB_CHECK_VERSION (2,15,0)
-	GFile *file;
-
 	file = g_file_new_for_commandline_arg (argv[1]);
 	uri = g_file_get_uri (file);
 	g_object_unref (file);
-#else
-	if (g_path_is_absolute (argv[1])) {
-		uri = g_filename_to_uri (argv[1], NULL, &error);
-	} else if (g_ascii_strncasecmp (argv[1], "file://", strlen ("file://")) == 0) {
-		uri = g_strdup (argv[1]);
-	} else if (!g_strrstr (argv[1], "://")) {
-		gchar *dir;
-		gchar *filename;
-
-		dir = g_get_current_dir ();
-		filename = g_build_filename (dir, argv[1], NULL);
-		g_free (dir);
-
-		uri = g_filename_to_uri (filename, NULL, &error);
-		g_free (filename);
-	} else {
-		g_print ("Error: unsupported uri\n");
-
-		return 1;
-	}
-
-	if (error) {
-		g_print ("Error: %s\n", error->message);
-		g_error_free (error);
-
-		return 1;
-	}
-#endif /* GLIB_CHECK_VERSION */
 
 	timer = g_timer_new ();
 	document = poppler_document_new_from_file (uri, NULL, &error);


More information about the poppler mailing list