Build xml file in

This commit is contained in:
Yevgen Muntyan 2005-09-08 19:17:23 +00:00
parent 05b775a581
commit 4fc1d390a1
3 changed files with 15 additions and 19 deletions

View File

@ -4,8 +4,6 @@
SUBDIRS = cproject
real_src_dir = `cd $(srcdir) && pwd`
DEFAULT_INCLUDES =
AM_CFLAGS = \
-DXDG_PREFIX=_moo_edit_xdg \
@ -17,7 +15,6 @@ AM_CFLAGS = \
$(GLADE_CFLAGS) \
-DG_LOG_DOMAIN=\"Moo\" \
-D__MOO__ \
-DMOO_GREP_GLADE_FILE=\"$(real_src_dir)/moogrep.glade\" \
-DMOO_MARSHALS_H=\"mooutils/moomarshals.h\"
if MINGW_BUILD
@ -35,4 +32,12 @@ noinst_LTLIBRARIES = libplugins.la
libplugins_la_SOURCES = \
mooeditplugins.h \
fileselector.c \
moogrep.c
moogrep.c \
moogrep-glade.h
BUILT_SOURCES = moogrep-glade.h
EXTRA_DIST = moogrep.glade
moogrep-glade.h: moogrep.glade
sh $(srcdir)/../../mooutils/xml2h.sh MOO_GREP_GLADE_XML $(srcdir)/moogrep.glade > \
moogrep-glade.h

View File

@ -19,6 +19,7 @@
#endif
#include "mooedit/mooplugin.h"
#include "mooedit/plugins/moogrep-glade.h"
#include "mooedit/plugins/mooeditplugins.h"
#include "mooedit/moofileview/moofileentry.h"
#include "mooedit/moopaneview.h"
@ -30,10 +31,6 @@
#include <errno.h>
#include <signal.h>
#ifndef MOO_GREP_GLADE_FILE
#define MOO_GREP_GLADE_FILE "moogrep.glade"
#endif
#define GREP_PLUGIN_ID "grep"
@ -256,8 +253,9 @@ create_dialog (MooEditWindow *window,
{
GtkWidget *dir_entry, *pattern_entry;
stuff->xml = glade_xml_new (MOO_GREP_GLADE_FILE, NULL, NULL);
stuff->xml = glade_xml_new_from_buffer (MOO_GREP_GLADE_XML,
strlen (MOO_GREP_GLADE_XML),
NULL, NULL);
g_return_if_fail (stuff->xml != NULL);
stuff->dialog = glade_xml_get_widget (stuff->xml, "dialog");

View File

@ -119,8 +119,6 @@ moo_markup_parse_memory (const char *buffer,
int size,
GError **error)
{
GError *err = NULL;
GMarkupParser parser = {(markup_start_element_func)start_element,
(markup_end_element_func)end_element,
(markup_text_func)text,
@ -138,14 +136,9 @@ moo_markup_parse_memory (const char *buffer,
state.current = MOO_MARKUP_NODE (doc);
context = g_markup_parse_context_new (&parser, (GMarkupParseFlags)0, &state, NULL);
if (!g_markup_parse_context_parse (context, buffer, size, &err) ||
!g_markup_parse_context_end_parse (context, &err))
if (!g_markup_parse_context_parse (context, buffer, size, error) ||
!g_markup_parse_context_end_parse (context, error))
{
if (err)
{
if (error) *error = err;
else g_error_free (err);
}
g_markup_parse_context_free (context);
moo_markup_doc_unref (doc);
return NULL;