[glom/glom-1-28] Revert "Use Gio::Resource::open_stream_global()."



commit 17faa3c8fefe1d6658d7ca77a97de300726c81a3
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 12 13:47:06 2015 +0100

    Revert "Use Gio::Resource::open_stream_global()."
    
    This reverts commit caa73681324271fb5be4f1e804e8e85bb3c103e4.
    
    This should never have been in the stable branch.

 glom/dialog_existing_or_new.cc |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index 3bdd54a..f2443a7 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -645,9 +645,17 @@ Glib::ustring Dialog_ExistingOrNew::get_title_from_example(const std::string& re
 {
   try
   {
-    Glib::RefPtr<Gio::InputStream> stream =
-      Gio::Resource::open_stream_global(resource_name);
+    GError* gerror = 0;
+    GInputStream* cstream =
+      g_resources_open_stream(resource_name.c_str(),
+        G_RESOURCE_LOOKUP_FLAGS_NONE, &gerror);
+    if(gerror)
+    {
+      Glib::Error::throw_exception(gerror);
+    }
     
+    Glib::RefPtr<Gio::InputStream> stream = Glib::wrap(cstream);
+
     //TODO: Really do this asynchronously?
     m_current_buffer.reset(new buffer);
     const int bytes_read = stream->read(m_current_buffer->buf, buffer::SIZE);


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