[glom/glom-1-28] Revert "Use Gio::Resource::get_info_global()."
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-28] Revert "Use Gio::Resource::get_info_global()."
- Date: Thu, 12 Feb 2015 12:49:00 +0000 (UTC)
commit a9d245e13a54d1e9dd33552f9179fe7f6cbb20e9
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Feb 12 13:47:30 2015 +0100
Revert "Use Gio::Resource::get_info_global()."
This reverts commit 3ec22eb2d3616d866feab7eee4962001b8270864.
This should never have been in the stable branch.
glom/libglom/utils.cc | 14 --------------
glom/libglom/utils.h | 7 -------
glom/libglom/xsl_utils.cc | 3 +--
.../print_layouts/print_layout_toolbar_button.cc | 3 +--
glom/utility_widgets/layouttoolbarbutton.cc | 3 +--
5 files changed, 3 insertions(+), 27 deletions(-)
---
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 3560d53..417aefc 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -26,7 +26,6 @@
#include <libglom/data_structure/glomconversions.h>
#include <giomm/file.h>
-#include <giomm/resource.h>
#include <glibmm/convert.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
@@ -1570,17 +1569,4 @@ bool Utils::script_check_for_pygtk2(const Glib::ustring& script)
return true;
}
-bool Utils::get_resource_exists(const std::string& resource_path)
-{
- try
- {
- Gio::Resource::get_info_global(resource_path);
- return true;
- }
- catch (const Gio::ResourceError&)
- {
- return false;
- }
-}
-
} //namespace Glom
diff --git a/glom/libglom/utils.h b/glom/libglom/utils.h
index 27d54e0..fbaabff 100644
--- a/glom/libglom/utils.h
+++ b/glom/libglom/utils.h
@@ -248,13 +248,6 @@ Glib::ustring get_temp_directory_uri(const std::string& prefix = std::string());
*/
bool script_check_for_pygtk2(const Glib::ustring& script);
-/**
- * This is simpler than catching the exception from Gio::Resource::get_info_global().
- *
- * @returns true if the GResource exists.
- */
-bool get_resource_exists(const std::string& resource_path);
-
} //namespace Utils
} //namespace Glom
diff --git a/glom/libglom/xsl_utils.cc b/glom/libglom/xsl_utils.cc
index 595c92b..739974c 100644
--- a/glom/libglom/xsl_utils.cc
+++ b/glom/libglom/xsl_utils.cc
@@ -24,7 +24,6 @@
#include <libglom/connectionpool.h>
#include <libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h>
#include <libglom/data_structure/glomconversions.h>
-#include <libglom/utils.h>
#include <libxml++/libxml++.h>
#include <libxslt/transform.h>
//#include <libexslt/exslt.h> //For exsltRegisterAll().
@@ -48,7 +47,7 @@ namespace
static std::string get_xslt_filepath(const std::string& xsl_file)
{
const std::string resource_path = "/org/gnome/glom/libglom/data/xslt/" + xsl_file;
- if(!Glom::Utils::get_resource_exists(resource_path))
+ if(!g_resources_get_info(resource_path.c_str(), G_RESOURCE_LOOKUP_FLAGS_NONE, 0, 0, 0))
{
std::cerr << G_STRFUNC << ": xslt resource not found: " << resource_path << std::endl;
}
diff --git a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
index 372cf12..d1653e5 100644
--- a/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
+++ b/glom/mode_design/print_layouts/print_layout_toolbar_button.cc
@@ -20,7 +20,6 @@
#include "print_layout_toolbar_button.h"
#include <glom/utils_ui.h>
-#include <libglom/utils.h>
#include <gtkmm/toolpalette.h>
#include <iostream>
@@ -34,7 +33,7 @@ PrintLayoutToolbarButton::PrintLayoutToolbarButton(const std::string& icon_name,
Gtk::Image* image = Gtk::manage (new Gtk::Image());
const std::string resource_path = UiUtils::get_icon_path(icon_name);
- if(!Utils::get_resource_exists(resource_path))
+ if(!g_resources_get_info(resource_path.c_str(), G_RESOURCE_LOOKUP_FLAGS_NONE, 0, 0, 0))
{
std::cerr << G_STRFUNC << ": icon resource not found: " << resource_path << std::endl;
}
diff --git a/glom/utility_widgets/layouttoolbarbutton.cc b/glom/utility_widgets/layouttoolbarbutton.cc
index 67ab349..44974ce 100644
--- a/glom/utility_widgets/layouttoolbarbutton.cc
+++ b/glom/utility_widgets/layouttoolbarbutton.cc
@@ -20,7 +20,6 @@
#include "layouttoolbarbutton.h"
#include <glom/utils_ui.h>
-#include <libglom/utils.h>
#include <iostream>
namespace Glom
@@ -33,7 +32,7 @@ LayoutToolbarButton::LayoutToolbarButton(const std::string& icon_name, LayoutWid
Gtk::Image* image = Gtk::manage (new Gtk::Image());
const std::string resource_path = UiUtils::get_icon_path(icon_name);
- if(!Utils::get_resource_exists(resource_path))
+ if(!g_resources_get_info(resource_path.c_str(), G_RESOURCE_LOOKUP_FLAGS_NONE, 0, 0, 0))
{
std::cerr << G_STRFUNC << ": icon resource not found: " << resource_path << std::endl;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]