[gnome-launch-box] finally drop libgnomevfs



commit e1a4581265c19a6638126511e0d93d4006dc9d6e
Author: Sven Herzberg <herzi gnome-de org>
Date:   Wed Feb 10 12:37:00 2010 +0100

    finally drop libgnomevfs
    
    * configure.ac: removed libgnomevfs
    * src/lb-main.c: dropped the initialization of gnomevfs
    * tests/Makefile.am,
    * tests/search-home.c: dropped the unused test
    * tests/mime-actions.c,
    * tests/search-applications.c: ported to gio

 configure.ac                |    3 ---
 src/lb-main.c               |    3 ---
 tests/Makefile.am           |    4 ----
 tests/mime-actions.c        |   41 ++++++++++++++++-------------------------
 tests/search-applications.c |    5 -----
 tests/search-home.c         |   38 --------------------------------------
 6 files changed, 16 insertions(+), 78 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 86a2544..f22b386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,8 +37,6 @@ GETTEXT_PACKAGE=gnome-launch-box
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
 
-ALL_LINGUAS="ar de fr sv"
-
 AM_GLIB_GNU_GETTEXT
 
 dnl -----------------------------------------------------------
@@ -58,7 +56,6 @@ PKG_CHECK_MODULES(LB,[
 	glib-2.0 >= 2.14
 	gio-unix-2.0
 	gtk+-2.0 >= 2.10
-	gnome-vfs-2.0 >= 2.10
 	libgnome-menu >= 2.10
 	gnome-desktop-2.0 >= 2.10
 	libebook-1.2 >= 1.8
diff --git a/src/lb-main.c b/src/lb-main.c
index 04e4ce4..642b8e8 100644
--- a/src/lb-main.c
+++ b/src/lb-main.c
@@ -22,7 +22,6 @@
 #include <string.h>
 #include <glib/gi18n.h>
 #include <gtk/gtkmain.h>
-#include <libgnomevfs/gnome-vfs-init.h>
 #include <gconf/gconf-client.h>
 
 #include "bacon-message-connection.h"
@@ -150,8 +149,6 @@ main (int argc, char **argv)
 		message_conn,
 		(BaconMessageReceivedFunc) message_received_cb,
 		NULL);
-	
-       	gnome_vfs_init ();
 
 	tomboy_keybinder_init ();
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d1c0be6..f4bbcc5 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -4,15 +4,11 @@ AM_CPPFLAGS =					\
 	$(LB_CFLAGS)
 
 noinst_PROGRAMS = 				\
-	search-home				\
 	search-applications			\
 	mime-actions				\
 	search-addresses			\
 	slug-search
 
-search_home_SOURCES = search-home.c
-search_home_LDADD = $(LB_LIBS)
-
 search_applications_SOURCES = search-applications.c
 search_applications_LDADD = $(LB_LIBS)
 
diff --git a/tests/mime-actions.c b/tests/mime-actions.c
index 3f49e4e..7e39fd9 100644
--- a/tests/mime-actions.c
+++ b/tests/mime-actions.c
@@ -18,22 +18,19 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <gtk/gtk.h>
 
 static void
-print_actions_for_file (const gchar      *file_uri,
-			GnomeVFSFileInfo *info)
+print_actions_for_file (GFileInfo *info)
 {
 	GList *applications, *list;
 	
-	applications = gnome_vfs_mime_get_all_applications (info->mime_type);
+	applications = g_app_info_get_all_for_type (g_file_info_get_content_type (info));
 
 	for (list = applications; list != NULL; list = list->next) {
-		GnomeVFSMimeApplication *application = list->data;
-		const gchar *name = gnome_vfs_mime_application_get_name (application);
-		const gchar *icon = gnome_vfs_mime_application_get_icon (application);
+		GAppInfo *application = list->data;
+		const gchar *name = g_app_info_get_name (application);
+		gchar *icon = g_icon_to_string (g_app_info_get_icon (application));
 		
 		g_print ("found: %s %s\n", name, icon);
 	}
@@ -42,36 +39,30 @@ print_actions_for_file (const gchar      *file_uri,
 gint
 main (gint argc, gchar **argv)
 {
-	gchar            *uri;
-	GnomeVFSFileInfo *info;
-	GnomeVFSResult    result;
+	GFileInfo* info;
+	GError   * error = NULL;
+	GFile    * file;
 
 	gtk_init (&argc, &argv);
-	gnome_vfs_init ();
 
 	if (argc < 2) {
 		printf ("%s <absolute path filename>\n", argv[0]);
 		return -1;
 	}
 
-	uri = g_filename_to_uri (argv[1], NULL, NULL);
-	if (!uri) {
-		g_printerr ("Invalid filename\n");
-		return -1;
-	}
-	
-	info = gnome_vfs_file_info_new ();
-	result = gnome_vfs_get_file_info (uri, info,
-					  GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
-	if (result != GNOME_VFS_OK) {
+	file = g_file_new_for_commandline_arg (argv[1]);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+			          0, NULL,
+				  &error);
+	if (error) {
 		g_printerr ("Could not open file: %s\n",
-			    gnome_vfs_result_to_string (result));
+			    error->message);
+		g_error_free (error);
 		
 		return -1;
 	}
 
-	print_actions_for_file (uri, info);
-	g_free (uri);
+	print_actions_for_file (info);
 
 	return 0;
 }
diff --git a/tests/search-applications.c b/tests/search-applications.c
index c24c1e7..04e8aed 100644
--- a/tests/search-applications.c
+++ b/tests/search-applications.c
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <libgnomevfs/gnome-vfs.h>
 #define GMENU_I_KNOW_THIS_IS_UNSTABLE
 #include <gnome-menus/gmenu-tree.h>
 
@@ -88,8 +87,6 @@ main (int argc, char **argv)
 	GSList *applications;
 	GSList *l;
 
-	gnome_vfs_init ();
-
 	applications = applications_get_list ();
 
 	for (l = applications; l; l = l->next) {
@@ -105,7 +102,5 @@ main (int argc, char **argv)
 
 	g_slist_free (applications);
 
-	gnome_vfs_shutdown ();
-
 	return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]