glom r1465 - in trunk: . glom



Author: murrayc
Date: Wed Mar 19 16:34:15 2008
New Revision: 1465
URL: http://svn.gnome.org/viewvc/glom?rev=1465&view=rev

Log:
2008-03-19  Murray Cumming  <murrayc murrayc com>

* glom/application.cc offer_new_or_existing(): Use a URI for the 
examples directory instead of a filepath, sot that the examples 
directory is really opened in the file chooser. gnome-vfs seems to 
have become less tolerant of URIs without file:// at the start.

Modified:
   trunk/ChangeLog
   trunk/glom/application.cc

Modified: trunk/glom/application.cc
==============================================================================
--- trunk/glom/application.cc	(original)
+++ trunk/glom/application.cc	Wed Mar 19 16:34:15 2008
@@ -1243,8 +1243,21 @@
     ui_bring_to_front();
 
     //Ask user to choose file to open:
+    //Create a URI (prefixed by file://) for this path).
+    //Previous versions of gnome-vfs could handle this without file://,
+    //but that stopped working at some point around Ubuntu Hardy. murrayc.
     //g_warning("GLOM_EXAMPLES_DIR=%s", GLOM_EXAMPLES_DIR);
-    Glib::ustring file_uri = ui_file_select_open(GLOM_EXAMPLES_DIR);
+    Glib::ustring examples_uri;
+    try
+    {
+      examples_uri = Glib::filename_to_uri(GLOM_EXAMPLES_DIR);
+    }
+    catch(const Glib::Error& ex)
+    {
+      std::cerr << "Glom: Error converting examples path to a URI: " << ex.what() << std::endl;
+    }
+    
+    Glib::ustring file_uri = ui_file_select_open(examples_uri);
     if(!file_uri.empty())
       open_document(file_uri);
 



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