[geany/geany-plugins] a33f91: scope - remember initial ignore count, version 0.93.2

Dimitar Zhekov git-noreply at xxxxx
Tue Feb 18 19:20:19 UTC 2014


Branch:      refs/heads/master
Author:      Dimitar Zhekov <dimitar.zhekov at gmail.com>
Committer:   Dimitar Zhekov <dimitar.zhekov at gmail.com>
Date:        Tue, 18 Feb 2014 19:20:19 UTC
Commit:      a33f914cfb8e8716b71eda947a67ca8dc45aab32
             https://github.com/geany/geany-plugins/commit/a33f914cfb8e8716b71eda947a67ca8dc45aab32

Log Message:
-----------
scope - remember initial ignore count, version 0.93.2


Modified Paths:
--------------
    scope/ChangeLog
    scope/NEWS
    scope/data/scope.glade
    scope/docs/codes.html
    scope/docs/scope.html
    scope/src/break.c
    scope/src/scope.c
    scope/src/store/scptreestore.c
    scope/src/views.c
    scope/src/views.h

Modified: scope/ChangeLog
32 files changed, 30 insertions(+), 2 deletions(-)
===================================================================
@@ -1,3 +1,30 @@
+2013-02-17  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
+
+ * src/store/scptreestore.c:
+   Fixed warning generated by emitting "rows-reordered" for empty
+   brances (g_new() returns NULL for 0 elements).
+ * docs/scope.html, src/scope.c:
+   Increased version to 0.93.2.
+
+
+2013-02-13  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
+
+ * data/scope.glade, docs/codes.html, docs/scope.html, src/break.c,
+   src/views.c, src/views.h:
+   Remember the total (initial) breakpoint ignore count and restore
+   it on each run.
+ * docs/codes.html, docs/scope.html:
+   Small changes and clarifications.
+
+
+2013-01-08  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
+
+ * src/utils.c:
+   Check whether file from a thread/breakpoint/stack location exists
+   before attempting to open it (gdb 7.6+ includes "fullname" for
+   missing files).
+
+
 2013-01-06  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
 
  * data/scope.glade, src/break.c:
@@ -25,6 +52,7 @@
  * docs/scope.html, src/scope.c:
    Increased version to 0.93.1.
 
+
 2013-10-26  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
 
  * src/memory.c:
@@ -90,8 +118,8 @@
 
 2013-08-25  Dimitar Zhekov  <dimitar.zhekov at gmail.com>
 
- * docs/codes.html, docs/scope.html, src/inspect.c,
-   src/prefs.c, src/prefs.h, src/views.c:
+ * docs/codes.html, docs/scope.html, src/inspect.c, src/prefs.c,
+   src/prefs.h, src/views.c:
    Fixed Inspect Refresh.
    Added an option to disable Inspect Refresh/update in Hang mode
    (causes internal gdb error).


Modified: scope/NEWS
9 files changed, 8 insertions(+), 1 deletions(-)
===================================================================
@@ -1,3 +1,10 @@
+Scope 0.93.2 (2013-02-13):
+
+    * Remember the total (initial) breakpoint ignore count and
+      restore it on each run. Saving the current (remaining) value
+      across restarts was not very useful.
+
+
 Scope 0.93.1 (2014-01-06):
 
     * Show breakpoint origin in the type column, with tooltip.
@@ -86,7 +93,7 @@ Scope 0.79 (2012-12-27)
 Scope 0.78 (2012-12-23)
 
    * Added option "keep_exec_point" to keep the execution point marker
-     and Threads location columns when a thread execution is resumed.
+     and Threads location column when a thread execution is resumed.
 
 
 Scope 0.77 (2012-12-16)


Modified: scope/data/scope.glade
2 files changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -1407,6 +1407,8 @@
       <column type="gchararray" utf8_collate="false"/>
       <!-- column-name break_store_script -->
       <column type="gchararray" utf8_collate="false"/>
+      <!-- column-name break_store_ignnow -->
+      <column type="gchararray" utf8_collate="false"/>
       <!-- column-name break_store_pending -->
       <column type="gboolean"/>
       <!-- column-name break_store_location -->


Modified: scope/docs/codes.html
24 files changed, 16 insertions(+), 8 deletions(-)
===================================================================
@@ -41,20 +41,28 @@
 
 <tr><td class="nowrap">022<id>-break-after</td>
 	<td class="tab">breakpoint <em>Ignore</em> column edited</td>
-	<td class="tab"><id>-break-info</td></tr>
+	<td class="tab">022-break-info <id></td></tr>
 
-<tr><td class="nowrap">022<id>-break-condition</td>
+<tr><td class="nowrap">023<id>-break-after</td>
+	<td class="tab">run program if ignore != [ignore]</td>
+	<td class="tab">022-break-info <id></td></tr>
+
+<tr><td class="nowrap">023<id>-break-condition</td>
 	<td class="tab">breakpoint <em>Condition</em> column edited</td>
-	<td class="tab"><id>-break-info</td></tr>
+	<td class="tab">-break-info <id></td></tr>
 
-<tr><td class="nowrap">022<id>-break-commands</td>
+<tr><td class="nowrap">023<id>-break-commands</td>
 	<td class="tab">breakpoint <em>Script</em> column edited</td>
-	<td class="tab"><id>-break-info</td></tr>
+	<td class="tab">-break-info <id></td></tr>
 
-<tr><td class="nowrap">023<id>-break-delete</td>
+<tr><td class="nowrap">024<id>-break-delete</td>
 	<td class="tab"><em>Delete</em> or un-<em>Toggle breakpoint</em></td>
 	<td class="tab">remove breakpoint from the list or clear id</td></tr>
 
+<tr><td class="nowrap">022-break-info</td>
+	<td class="tab">see 022<id>-break-after</td>
+	<td class="tab">load break info and set [IGNORE] count</td></tr>
+
 <tr><td class="nowrap">02-break-list</td>
 	<td class="tab"><em>Refresh</em> breakpoints</td>
 	<td class="tab">full breakpoint list refresh (without token is partial)</td></tr>
@@ -100,7 +108,7 @@
 	<td class="tab">029<fid>-data-list-register-values <all></td>
 
 <tr><td class="nowrap">029<fid>-data-list-register-values</td>
-	<td class="tab"><em>Refresh</em> registers, see above</td>
+	<td class="tab"><em>Refresh</em> registers, see prev line</td>
 	<td class="tab">update register values</td>
 
 <tr><td class="nowrap">02<f><fid>-data-list-register-values</td>
@@ -168,7 +176,7 @@
 	<td class="tab">049<fid>-data-list-register-values <changed></td>
 
 <tr><td class="nowrap">049<fid>-data-list-register-values</td>
-	<td class="tab">views idle update, see above</td>
+	<td class="tab">views idle update, see prev line</td>
 	<td class="tab">same as 02</td>
 
 <tr><td class="nowrap">04<scid>-var-evaluate-expression</td>


Modified: scope/docs/scope.html
19 files changed, 14 insertions(+), 5 deletions(-)
===================================================================
@@ -50,7 +50,7 @@
 		<li><a href="#local_watch">Locals/Watches</a></li>
 		<li><a href="#console">Debug Console</a></li>
 	</ul></li>
-	<li>Side panel<ul>
+	<li>Side pages<ul>
 		<li><a href="#inspect">Inspect</a></li>
 		<li><a href="#register">Registers</a></li>
 	</ul></li>
@@ -363,14 +363,21 @@
 invoke <em>Add Break / Add Watch</em> [HRD], which brings up the command dialog.</p>
 
 <p>Breakpoints created with MI commands are kept in the list permanently. When a temporary MI
-breakpoint is hit, it's Id column is cleared. <em>Toggle breakpoint</em>, <em>Add Break</em>
-and <em>Add Watch</em> use MI commands.</p>
+breakpoint is hit, it's <em>Id</em> column is cleared. <em>Toggle breakpoint</em>, <em>Add
+Break</em> and <em>Add Watch</em> use MI commands.</p>
 
 <p>Breakpoints created with CLI commands (from scripts or <em>GDB Command</em>) are removed
 when the program is unloaded. When a temporary CLI breakpoint is hit, it's removed. If a MI
 command produces none or invalid output, and the breapoint appears later (from Refresh or
 async message), Scope will consider it CLI.</p>
 
+<p>Scope remembers the total (initial) ignore count, and re-applies it on each run. When a
+breakpoint is applied, <em>Ignore</em> shows the current value, followed by the total value
+surrounded in brackets. On gdb 'ignore' (or -break-after followed by refresh), the total value
+will be set only if the new count is larger: there is no way to tell whether a smaller count
+resulted from a command execution or breakpoint hit(s). Edit the <em>Ignore</em> column to set
+a smaller count.</p>
+
 <p>The above paragraphs apply to watchpoints and tracepoints as well.</p>
 
 <div>Due to MI limitations and deficiencies:</div>
@@ -388,7 +395,7 @@
 a local expression.</p>
 
 <p>Shift-clicking <em>Apply</em> applies the breakpoint for the currently selected thread
-only.</p>
+only, if any.</p>
 
 <p>GDB may report an error for invalid <em>Condition</em> and/or <em>Script</em>, but still
 accept them, and continue to emit errors each time they are evaluated.</p>
@@ -467,6 +474,8 @@
 immediately resuming the program execution; or the prompt may be followed by asynchronous
 messages. The Scope state (Busy, Debug etc.) is more accurate.</p>
 
+<h3>Side pages</h3>
+
 <p><b><a name="inspect">Inspect</a></b></p>
 
 <p>-var-* commands entered from the command line will not update the <em>Inspect</em> view,
@@ -758,7 +767,7 @@
 
 <b><a name="copyright">Copyright</a></b>
 
-<p>Scope 0.93.1, Copyright (C) 2013 Dimitar Toshkov Zhekov</p>
+<p>Scope 0.93.2, Copyright (C) 2013 Dimitar Toshkov Zhekov</p>
 
 <p>The menu and toolbar icons are from <a href="http://netbeans.org">Netbeans</a>, except for
 BreakPoint.</p>


Modified: scope/src/break.c
153 files changed, 114 insertions(+), 39 deletions(-)
===================================================================
@@ -39,6 +39,7 @@ enum
 	BREAK_IGNORE,
 	BREAK_COND,
 	BREAK_SCRIPT,
+	BREAK_IGNNOW,
 	BREAK_PENDING,
 	BREAK_LOCATION,
 	BREAK_RUN_APPLY,
@@ -114,8 +115,9 @@ static gint break_location_compare(ScpTreeStore *store, GtkTreeIter *a, GtkTreeI
 	BG_DISCARD,
 	BG_UNKNOWN,
 	BG_PARTLOC,
-	BG_APPLY,
+	BG_APPLIED,
 	BG_FOLLOW,
+	BG_IGNORE,
 	BG_ONLOAD,
 	BG_RUNTO,
 	BG_COUNT
@@ -135,6 +137,7 @@ static gint break_location_compare(ScpTreeStore *store, GtkTreeIter *a, GtkTreeI
 	{ '\0', NULL },
 	{ '\0', NULL },
 	{ 'c',  N_("CLI") },
+	{ '\0', NULL },
 	{ 'l',  N_("on load") },
 	{ 'r',  N_("Run to Cursor") }
 };
@@ -166,6 +169,24 @@ static void break_type_set_data_func(G_GNUC_UNUSED GtkTreeViewColumn *column,
 	g_string_free(string, TRUE);
 }
 
+static void break_ignore_set_data_func(G_GNUC_UNUSED GtkTreeViewColumn *column,
+	GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter,
+	G_GNUC_UNUSED gpointer gdata)
+{
+	const gchar *ignore, *ignnow;
+
+	gtk_tree_model_get(model, iter, BREAK_IGNORE, &ignore, BREAK_IGNNOW, &ignnow, -1);
+
+	if (ignnow)
+	{
+		char *text = g_strdup_printf("%s [%s]", ignnow, ignore);
+		g_object_set(cell, "text", text, NULL);
+		g_free(text);
+	}
+	else
+		g_object_set(cell, "text", ignore, NULL);
+}
+
 static ScpTreeStore *store;
 static GtkTreeSelection *selection;
 static gint scid_gen = 0;
@@ -239,24 +260,42 @@ static void on_break_column_edited(G_GNUC_UNUSED GtkCellRendererText *renderer,
 	{
 		char *locale = utils_get_locale_from_display(new_text, HB_DEFAULT);
 
-		debug_send_format(F, "022%s-break-%s %s %s", id, break_command(index, type), id,
-			locale ? locale : index ? "" : "0");
+		if (index)
+		{
+			debug_send_format(F, "023%s-break-%s %s %s", id, break_command(index, type),
+				id, locale ? locale : "");
+		}
+		else
+		{
+			debug_send_format(N, "022%s-break-%s %s %s", id, break_command(0, type), id,
+				locale ? locale : "0");
+		}
 		g_free(locale);
 	}
 	else if (!id)
-		scp_tree_store_set(store, &iter, index + BREAK_IGNORE, set_text, -1);
+	{
+		scp_tree_store_set(store, &iter, index + BREAK_IGNORE, set_text,
+			index ? -1 : BREAK_IGNNOW, NULL, -1);
+	}
 	else
 		plugin_beep();
 }
 
 static void on_break_ignore_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell,
-	GtkCellEditable *editable, G_GNUC_UNUSED const gchar *path, G_GNUC_UNUSED gpointer gdata)
+	GtkCellEditable *editable, const gchar *path_str, G_GNUC_UNUSED gpointer gdata)
 {
+	GtkTreeIter iter;
+	const gchar *ignore;
+
 	if (GTK_IS_EDITABLE(editable))
 		validator_attach(GTK_EDITABLE(editable), VALIDATOR_NUMERIC);
 
 	if (GTK_IS_ENTRY(editable))
 		gtk_entry_set_max_length(GTK_ENTRY(editable), 10);
+
+	scp_tree_store_get_iter_from_string(store, &iter, path_str);
+	scp_tree_store_get(store, &iter, BREAK_IGNORE, &ignore, -1);
+	g_signal_connect(editable, "map", G_CALLBACK(on_view_editable_map), g_strdup(ignore));
 }
 
 static const TreeCell break_cells[] =
@@ -376,10 +415,13 @@ static void break_node_parse(const ParseNode *node, BreakData *bd)
 		borts = strchr(BP_BORTS, type) != NULL;
 		parse_location(nodes, &loc);
 
-		if (bd->stage != BG_APPLY)
+		if (bd->stage != BG_APPLIED)
 		{
 			const ParseNode *script = parse_find_node(nodes, "script");
 			GtkTreeIter iter1;
+			gchar *cond = utils_get_display_from_7bit(parse_find_value(nodes, "cond"),
+				HB_DEFAULT);
+			gchar *commands;
 
 			if (store_find(store, &iter1, BREAK_ID, id))
 			{
@@ -452,7 +494,7 @@ static void break_node_parse(const ParseNode *node, BreakData *bd)
 
 			if (script)
 			{
-				GString *string = g_string_sized_new(0x3F);
+				GString *string = g_string_sized_new(0x7F);
 
 				if (script->type == PT_VALUE)
 					append_script_command(script, string);
@@ -462,23 +504,29 @@ static void break_node_parse(const ParseNode *node, BreakData *bd)
 						(GFunc) append_script_command, string);
 				}
 
-				scp_tree_store_set(store, iter, BREAK_SCRIPT, string->str, -1);
-				g_string_free(string, TRUE);
+				commands = g_string_free(string, FALSE);
 			}
 			else
-				scp_tree_store_set(store, iter, BREAK_SCRIPT, NULL, -1);
+				commands = NULL;
+
+			scp_tree_store_set(store, iter, BREAK_ENABLED, enabled, BREAK_COND, cond,
+				BREAK_SCRIPT, commands, -1);
+			g_free(cond);
+			g_free(commands);
 		}
 
-		if (borts || bd->stage != BG_APPLY)
+		if (strchr(BP_BREAKS, type) || bd->stage != BG_APPLIED)
 		{
-			gchar *cond = utils_get_display_from_7bit(parse_find_value(nodes, "cond"),
-				HB_DEFAULT);
-			const char *ignore = parse_find_value(nodes, "ignore");
+			const char *ignnow = parse_find_value(nodes, "ignore");
+			const char *ignore;
 
-			scp_tree_store_set(store, iter, BREAK_ENABLED, enabled, BREAK_COND, cond,
-				strchr(BP_BREAKS, type) || bd->stage != BG_APPLY ? BREAK_IGNORE : -1,
-				ignore ? ignore : parse_find_value(nodes, "pass"), -1);
-			g_free(cond);
+			if (!ignnow)
+				ignnow = parse_find_value(nodes, "pass");
+
+			scp_tree_store_get(store, iter, BREAK_IGNORE, &ignore, -1);
+			scp_tree_store_set(store, iter, BREAK_IGNNOW, ignnow,
+				!ignore || utils_atoi0(ignnow) > atoi(ignore) ||
+				bd->stage == BG_IGNORE ? BREAK_IGNORE : -1, ignnow, -1);
 		}
 
 		scp_tree_store_set(store, iter, BREAK_ID, id, BREAK_FILE, loc.file, BREAK_LINE,
@@ -487,7 +535,7 @@ static void break_node_parse(const ParseNode *node, BreakData *bd)
 
 		parse_location_free(&loc);
 
-		if (bd->stage == BG_APPLY)
+		if (bd->stage == BG_APPLIED)
 			break_iter_applied(iter, id);
 		else if (bd->stage == BG_RUNTO)
 			debug_send_thread("-exec-continue");
@@ -512,7 +560,7 @@ void on_break_inserted(GArray *nodes)
 			iff (store_find(store, &bd.iter, BREAK_SCID, token), "%s: b_scid not found",
 				token)
 			{
-				bd.stage = BG_APPLY;
+				bd.stage = BG_APPLIED;
 			}
 		}
 		else
@@ -527,7 +575,7 @@ static void break_apply(GtkTreeIter *iter, gboolean thread)
 	GString *command = g_string_sized_new(0x1FF);
 	gint scid;
 	char type;
-	const char *ignore, *location;
+	const char *ignore, *location, *s;
 	gboolean enabled, pending, temporary;
 	const gchar *cond;
 	gboolean borts;
@@ -574,7 +622,16 @@ static void break_apply(GtkTreeIter *iter, gboolean thread)
 	else if (strchr(BP_WATOPTS, type))
 		g_string_append_printf(command, " -%c", type);
 
-	g_string_append_printf(command, " %s", location);
+	for (s = location; *s; s++)
+	{
+		if (isspace(*s))
+		{
+			s = "\"";
+			break;
+		}
+	}
+
+	g_string_append_printf(command, " %s%s%s", s, location, s);
 	debug_send_command(F, command->str);
 	g_string_free(command, TRUE);
 }
@@ -584,7 +641,7 @@ static void break_clear(GtkTreeIter *iter)
 	char type;
 
 	scp_tree_store_get(store, iter, BREAK_TYPE, &type, -1);
-	scp_tree_store_set(store, iter, BREAK_ID, NULL, BREAK_ADDR, NULL,
+	scp_tree_store_set(store, iter, BREAK_ID, NULL, BREAK_ADDR, NULL, BREAK_IGNNOW, NULL,
 		strchr(BP_BORTS, type) ? -1 : BREAK_TEMPORARY, FALSE, -1);
 }
 
@@ -630,32 +687,36 @@ static gboolean break_remove_all(const char *pref, gboolean force)
 void on_break_done(GArray *nodes)
 {
 	const char *token = parse_grab_token(nodes);
-	GtkTreeIter iter;
+	const char oper = *token++;
+	const char *prefix = "";
 
-	switch (*token)
+	switch (oper)
 	{
 		case '0' :
 		case '1' :
 		{
-			iff (store_find(store, &iter, BREAK_SCID, token + 1), "%s: b_scid not found",
+			GtkTreeIter iter;
+
+			iff (store_find(store, &iter, BREAK_SCID, token), "%s: b_scid not found",
 				token)
 			{
-				break_enable(&iter, *token == '1');
+				break_enable(&iter, oper == '1');
 			}
 			break;
 		}
-		case '2' :
+		case '2' : prefix = "022";  /* and continue */
+		case '3' :
 		{
-			debug_send_format(N, "-break-info %s", token + 1);
+			debug_send_format(N, "%s-break-info %s", prefix, token);
 			break;
 		}
-		case '3' :
+		case '4' :
 		{
-			if (!break_remove_all(token + 1, TRUE))
+			if (!break_remove_all(token, TRUE))
 				dc_error("%s: bid not found", token);
 			break;
 		}
-		default : dc_error("%s: invalid b_oper", token);
+		default : dc_error("%c%s: invalid b_oper", oper, token);
 	}
 }
 
@@ -697,13 +758,14 @@ void on_break_list(GArray *nodes)
 {
 	iff ((nodes = parse_find_array(parse_lead_array(nodes), "body")) != NULL, "no body")
 	{
-		gboolean refresh = parse_grab_token(nodes) != NULL;
+		const char *token = parse_grab_token(nodes);
+		gboolean refresh = !g_strcmp0(token, "");
 		BreakData bd;
 
 		if (refresh)
 			store_foreach(store, (GFunc) break_iter_missing, NULL);
 
-		bd.stage = BG_DISCARD;
+		bd.stage = !g_strcmp0(token, "2") ? BG_IGNORE : BG_DISCARD;
 		parse_foreach(nodes, (GFunc) break_node_parse, &bd);
 
 		if (refresh)
@@ -766,7 +828,7 @@ static void break_delete(GtkTreeIter *iter)
 	if (debug_state() == DS_INACTIVE || !id)
 		break_remove(iter);
 	else
-		debug_send_format(N, "023%s-break-delete %s", id, id);
+		debug_send_format(N, "024%s-break-delete %s", id, id);
 }
 
 static void break_iter_mark(GtkTreeIter *iter, GeanyDocument *doc)
@@ -821,12 +883,22 @@ void breaks_reset(void)
 
 static void break_iter_apply(GtkTreeIter *iter, G_GNUC_UNUSED gpointer gdata)
 {
-	const char *id;
+	const char *id, *ignore, *ignnow;
+	char type;
 	gboolean run_apply;
 
-	scp_tree_store_get(store, iter, BREAK_ID, &id, BREAK_RUN_APPLY, &run_apply, -1);
+	scp_tree_store_get(store, iter, BREAK_ID, &id, BREAK_TYPE, &type, BREAK_IGNORE, &ignore,
+		BREAK_IGNNOW, &ignnow, BREAK_RUN_APPLY, &run_apply, -1);
 
-	if (run_apply && !id)
+	if (id)
+	{
+		if (g_strcmp0(ignore, ignnow))
+		{
+			debug_send_format(F, "023-break-%s %s %s", break_command(0, type), id,
+				ignore);
+		}
+	}
+	else if (run_apply)
 		break_apply(iter, FALSE);
 }
 
@@ -1373,13 +1445,16 @@ void break_init(void)
 {
 	GtkWidget *menu;
 	guint i;
+	GtkCellRenderer *break_ignore = GTK_CELL_RENDERER(get_object("break_ignore"));
 
 	break_type_column = get_column("break_type_column");
 	break_display_column = get_column("break_display_column");
 	tree = view_connect("break_view", &store, &selection, break_cells, "break_window", NULL);
 	gtk_tree_view_column_set_cell_data_func(break_type_column,
 		GTK_CELL_RENDERER(get_object("break_type")), break_type_set_data_func, NULL, NULL);
-	g_signal_connect(get_object("break_ignore"), "editing-started",
+	gtk_tree_view_column_set_cell_data_func(get_column("break_ignore_column"), break_ignore,
+		break_ignore_set_data_func, NULL, NULL);
+	g_signal_connect(break_ignore, "editing-started",
 		G_CALLBACK(on_break_ignore_editing_started), NULL);
 	view_set_sort_func(store, BREAK_ID, break_id_compare);
 	view_set_sort_func(store, BREAK_IGNORE, store_gint_compare);


Modified: scope/src/scope.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -32,7 +32,7 @@
 PLUGIN_VERSION_CHECK(215)
 
 PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE, _("Scope Debugger"),
-	_("Relatively simple GDB front-end."), "0.93",
+	_("Relatively simple GDB front-end."), "0.93.2",
 	"Dimitar Toshkov Zhekov <dimitar.zhekov at gmail.com>")
 
 /* Keybinding(s) */


Modified: scope/src/store/scptreestore.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2036,7 +2036,7 @@ void scp_tree_store_register_dynamic(void)
 	if (!type)
 	{
 		type = scp_tree_store_get_type();
-		g_type_class_unref(g_type_class_ref(type));  /* force class create */
+		g_type_class_unref(g_type_class_ref(type));  /* force class creation */
 	}
 	else if (!scp_tree_store_type_id_volatile)
 	{


Modified: scope/src/views.c
31 files changed, 17 insertions(+), 14 deletions(-)
===================================================================
@@ -246,6 +246,22 @@ gboolean on_view_query_base_tooltip(GtkWidget *widget, gint x, gint y, gboolean
 	return FALSE;
 }
 
+gboolean on_view_editable_map(GtkWidget *widget, gchar *replace)
+{
+	iff (GTK_IS_EDITABLE(widget), "cell editable: not an editable")
+	{
+		gint position = 0;
+		GtkEditable *editable = GTK_EDITABLE(widget);
+
+		gtk_editable_delete_text(editable, 0, -1);
+		gtk_editable_insert_text(editable, replace ? replace : "", -1, &position);
+		gtk_editable_select_region(editable, -1, 0);
+		g_free(replace);
+	}
+
+	return FALSE;
+}
+
 GtkTreeView *view_create(const char *name, ScpTreeStore **store, GtkTreeSelection **selection)
 {
 	GtkTreeView *tree = GTK_TREE_VIEW(get_widget(name));
@@ -262,18 +278,6 @@ static void on_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell, GtkCellEdita
 		gtk_entry_set_cursor_hadjustment(GTK_ENTRY(editable), hadjustment);
 }
 
-static gboolean on_display_editable_map(GtkWidget *widget, gchar *display)
-{
-	gint position = 0;
-	GtkEditable *editable = GTK_EDITABLE(widget);
-
-	gtk_editable_delete_text(editable, 0, -1);
-	gtk_editable_insert_text(editable, display ? display : "", -1, &position);
-	gtk_editable_select_region(editable, -1, 0);
-	g_free(display);
-	return FALSE;
-}
-
 static void on_display_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell,
 	GtkCellEditable *editable, const gchar *path_str, ScpTreeStore *store)
 {
@@ -281,11 +285,10 @@ static void on_display_editing_started(G_GNUC_UNUSED GtkCellRenderer *cell,
 	const char *value;
 	gint hb_mode;
 
-	g_assert(GTK_IS_EDITABLE(editable));
 	scp_tree_store_get_iter_from_string(store, &iter, path_str);
 	scp_tree_store_get(store, &iter, COLUMN_VALUE, &value, COLUMN_HB_MODE, &hb_mode, -1);
 	/* scrolling editable to the proper position is left as an exercise for the reader */
-	g_signal_connect(editable, "map", G_CALLBACK(on_display_editable_map),
+	g_signal_connect(editable, "map", G_CALLBACK(on_view_editable_map),
 		parse_get_display_from_7bit(value, hb_mode, MR_EDITVC));
 }
 


Modified: scope/src/views.h
1 files changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -51,6 +51,7 @@
 gboolean on_view_button_1_press(GtkWidget *widget, GdkEventButton *event, ViewSeeker seeker);
 gboolean on_view_query_base_tooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_tip,
 	GtkTooltip *tooltip, GtkTreeViewColumn *base_name_column);
+gboolean on_view_editable_map(GtkWidget *widget, gchar *replace);
 
 enum
 {



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list