glom r1464 - in branches/glom-1-6: . glom



Author: murrayc
Date: Wed Mar 19 16:33:53 2008
New Revision: 1464
URL: http://svn.gnome.org/viewvc/glom?rev=1464&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:
   branches/glom-1-6/ChangeLog
   branches/glom-1-6/glom/application.cc

Modified: branches/glom-1-6/glom/application.cc
==============================================================================
--- branches/glom-1-6/glom/application.cc	(original)
+++ branches/glom-1-6/glom/application.cc	Wed Mar 19 16:33:53 2008
@@ -1204,8 +1204,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]