[glom] Use Gio::Resource::open_stream_global().



commit caa73681324271fb5be4f1e804e8e85bb3c103e4
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Nov 16 16:33:50 2014 +0100

    Use Gio::Resource::open_stream_global().
    
    Instead of g_resources_open_stream().

 glom/dialog_existing_or_new.cc |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index d924af1..866f351 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -649,17 +649,9 @@ Glib::ustring Dialog_ExistingOrNew::get_title_from_example(const std::string& re
 {
   try
   {
-    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 =
+      Gio::Resource::open_stream_global(resource_name);
     
-    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]