[cairo-commit] roadster/src import_tiger.c,1.26,1.27

Jeff Garrett commit at pdx.freedesktop.org
Mon Oct 29 22:25:14 PDT 2007


Committed by: jgarrett

Update of /cvs/cairo/roadster/src
In directory kemper:/tmp/cvs-serv637/src

Modified Files:
	import_tiger.c 
Log Message:
2007-10-30 Jeff Garrett <jeff at jgarrett.org>

	* src/import_tiger.c: Allow remote URIs in import_tiger_from_uri


Index: import_tiger.c
===================================================================
RCS file: /cvs/cairo/roadster/src/import_tiger.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- import_tiger.c	8 Sep 2007 08:55:45 -0000	1.26
+++ import_tiger.c	30 Oct 2007 05:25:11 -0000	1.27
@@ -1193,18 +1193,23 @@
 
 	importwindow_progress_pulse();
 
+	//
+	// Make a temporary directory
+	//
+	gchar* pszTempDir = g_strdup_printf("%s/roadster", g_get_tmp_dir());
+	gnome_vfs_make_directory(pszTempDir, 0700);
+	gchar* pszLocalFileUri  = g_strdup_printf("file:///%s/tiger.zip", pszTempDir);
+
 	// convert from "file:///path/to/file" to "/path/to/file" (only works on local files)
-	gchar* pszLocalFilePath = gnome_vfs_get_local_path_from_uri(pszURI);
+	gchar* pszLocalFilePath = gnome_vfs_get_local_path_from_uri(pszLocalFileUri);
 	if(pszLocalFilePath == NULL) {
 		g_warning("import_tiger_from_uri: gnome_vfs_get_local_path_from_uri failed (not local?)\n");
 		return FALSE;
 	}
 	
-	//
-	// Make a temporary directory for ZIP file contents
-	//
-	gchar* pszTempDir = g_strdup_printf("%s/roadster", g_get_tmp_dir());
-	gnome_vfs_make_directory(pszTempDir, 0700);
+	GnomeVFSURI *src = gnome_vfs_uri_new(pszURI);
+	GnomeVFSURI *dst = gnome_vfs_uri_new(pszLocalFileUri);
+	gnome_vfs_xfer_uri(src, dst, GNOME_VFS_XFER_DEFAULT, GNOME_VFS_XFER_ERROR_MODE_ABORT, GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE, NULL, NULL);
 
 	//
 	// Create unzip command line



More information about the cairo-commit mailing list