[Github-comments] [geany/geany-plugins] scope: removed invalid signal 'project-before-save' and callback function (#751)

LarsGit223 notifications at xxxxx
Wed Jun 6 05:20:50 UTC 2018


Or maybe ```project-save```?

For the ```project-before-save``` event the following code would have been run (with ```conterm=FALSE```):
```
	guint i = 0;

	plugin_idle_add(geany_plugin, settings_saved, GINT_TO_POINTER(conterm));

	foreach_document(i)
	{
		if (utils_attrib(documents[i], SCOPE_LOCK))
			documents[i]->readonly = FALSE;
	}
```
And function ```settings_saved``` looks like this:
```
static gboolean settings_saved(gpointer gdata)
{
	guint i = 0;

	foreach_document(i)
	{
		documents[i]->readonly = scintilla_send_message(documents[i]->editor->sci,
			SCI_GETREADONLY, 0, 0);
	}

	if (gdata)
	{
		conterm_load_config();
		conterm_apply_config();
	}

	return FALSE;
}
```
The code in ```if (gdata)``` is not executed in this case as ```gdata``` would be ```FALSE```. The function is also called on the event ```save-settings``` and then ```conterm```/```gdata``` is set to ```TRUE``` and the config will be reloaded. This still works fine. If I e.g. change the terminal background color in the preferences the change is applied immediately.

I wonder what this READONLY check is good for. Can the document status change by changing/saving the project?

As I never have seen the six years old code in action I can't see any difference and it looks useless to me.

Maybe there were plans to also save some scope settings in the project then it would make sense to also reload the config at that point. But all settings which scope loads in ```conterm_load_config();``` come from ```geany.conf```.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/751#issuecomment-394943434
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20180605/e4bcd8e2/attachment.html>


More information about the Github-comments mailing list