[glom/glom-1-28] Revert "Dialog_ExistingOrNew::list_examples(): Use Gio::Resource."
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-28] Revert "Dialog_ExistingOrNew::list_examples(): Use Gio::Resource."
- Date: Thu, 12 Feb 2015 12:49:05 +0000 (UTC)
commit e3c26f707af97eb35da96679240ef25bd4a0c4fa
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Feb 12 13:47:56 2015 +0100
Revert "Dialog_ExistingOrNew::list_examples(): Use Gio::Resource."
This reverts commit df255452e6bc34b362932dde4eb9bcf9d93fdd89.
This should never have been in the stable branch.
glom/dialog_existing_or_new.cc | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/glom/dialog_existing_or_new.cc b/glom/dialog_existing_or_new.cc
index f2443a7..8d80c51 100644
--- a/glom/dialog_existing_or_new.cc
+++ b/glom/dialog_existing_or_new.cc
@@ -26,7 +26,6 @@
#include <glibmm/i18n.h>
#include <giomm/contenttype.h>
-#include <giomm/resource.h>
#include <gtkmm/recentmanager.h>
#include <gtkmm/filechooserdialog.h>
#include <glibmm/miscutils.h>
@@ -264,9 +263,18 @@ bool Dialog_ExistingOrNew::list_examples()
try
{
+ //TODO: Add to glibmm? const type_vec_strings examples = Gio::Resource::enumerate_children(examples_dir);
+ GError* gerror = 0;
+ char** cexamples = g_resources_enumerate_children(examples_dir, G_RESOURCE_LOOKUP_FLAGS_NONE, &gerror);
+ if(gerror)
+ {
+ Glib::Error::throw_exception(gerror);
+ }
+
typedef std::vector<Glib::ustring> type_vec_strings;
- const type_vec_strings examples = Gio::Resource::enumerate_children_global(examples_dir);
-
+ const type_vec_strings examples =
+ Glib::ArrayHandler<Glib::ustring>::array_to_vector(cexamples, Glib::OWNERSHIP_DEEP);
+
bool example_found = false;
for(type_vec_strings::const_iterator iter = examples.begin(); iter != examples.end(); ++iter)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]