From: John Darrington Date: Thu, 1 Jan 2009 08:12:06 +0000 (+0900) Subject: Re-enable reporting of filename in syntax errors X-Git-Tag: v0.7.3~296^2~14 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1efacfa55381cfdbd7f01006f217f1d03a4c48af;p=pspp-builds.git Re-enable reporting of filename in syntax errors --- diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index c8fede09..073537bd 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -106,10 +106,12 @@ psppire_syntax_window_base_finalize (PsppireSyntaxWindowClass *class, static void -editor_execute_syntax (const PsppireSyntaxWindow *se, GtkTextIter start, - GtkTextIter stop) +editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start, + GtkTextIter stop) { - execute_syntax (create_syntax_editor_source (se->buffer, start, stop)); + PsppireWindow *win = PSPPIRE_WINDOW (sw); + const gchar *name = psppire_window_get_filename (win); + execute_syntax (create_syntax_editor_source (sw->buffer, start, stop, name)); } diff --git a/src/ui/gui/psppire-window.c b/src/ui/gui/psppire-window.c index b40ccf14..c1333769 100644 --- a/src/ui/gui/psppire-window.c +++ b/src/ui/gui/psppire-window.c @@ -378,7 +378,7 @@ const gchar * psppire_window_get_filename (PsppireWindow *w) { const gchar *name = NULL; - g_object_get (w, "filename", name, NULL); + g_object_get (w, "filename", &name, NULL); return name; } diff --git a/src/ui/gui/syntax-editor-source.c b/src/ui/gui/syntax-editor-source.c index 9e1f2e87..21437051 100644 --- a/src/ui/gui/syntax-editor-source.c +++ b/src/ui/gui/syntax-editor-source.c @@ -36,6 +36,7 @@ struct syntax_editor_source GtkTextBuffer *buffer; GtkTextIter i; GtkTextIter end; + const gchar *name; }; @@ -49,10 +50,8 @@ always_false (const struct getl_interface *i UNUSED) static const char * name (const struct getl_interface *i) { - // const struct syntax_editor_source *ses = - // (const struct syntax_editor_source *) i; - - return "I have no idea"; // window_name ((const struct editor_window *) ses->se); + const struct syntax_editor_source *ses = (const struct syntax_editor_source *) i; + return ses->name; } @@ -105,7 +104,8 @@ do_close (struct getl_interface *i ) struct getl_interface * create_syntax_editor_source (GtkTextBuffer *buffer, GtkTextIter start, - GtkTextIter stop + GtkTextIter stop, + const gchar *nm ) { struct syntax_editor_source *ses = xzalloc (sizeof *ses); @@ -113,6 +113,7 @@ create_syntax_editor_source (GtkTextBuffer *buffer, ses->buffer = buffer; ses->i = start; ses->end = stop; + ses->name = nm; ses->parent.interactive = always_false; diff --git a/src/ui/gui/syntax-editor-source.h b/src/ui/gui/syntax-editor-source.h index f66c46f9..f8d08eaa 100644 --- a/src/ui/gui/syntax-editor-source.h +++ b/src/ui/gui/syntax-editor-source.h @@ -25,7 +25,8 @@ struct syntax_editor; struct getl_interface * create_syntax_editor_source (GtkTextBuffer *buffer, GtkTextIter start, - GtkTextIter stop + GtkTextIter stop, + const gchar *name );