[glom/glom-1-28] Revert "Utils:get_resource_exists(): Use the latest Gio::Resource API."



commit 0177c0fd078599143b7f456edf34d8f893d6f476
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 12 13:46:37 2015 +0100

    Revert "Utils:get_resource_exists(): Use the latest Gio::Resource API."
    
    This reverts commit 47f09d00ea890bef7e42d50ad0dbbd7428864dbb.
    
    This should never have been in the stable branch.

 glom/libglom/utils.cc |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 48c77af..3560d53 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -1572,7 +1572,15 @@ bool Utils::script_check_for_pygtk2(const Glib::ustring& script)
 
 bool Utils::get_resource_exists(const std::string& resource_path)
 {
-  return Gio::Resource::get_file_exists_global_nothrow(resource_path);
+  try
+  {
+     Gio::Resource::get_info_global(resource_path);
+     return true;
+  }
+  catch (const Gio::ResourceError&)
+  {
+     return false;
+  }
 }
 
 } //namespace Glom


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