[Github-comments] [geany/geany] Save main and project configuration whenever documents are opened/closed (#2114)

Enrico Tröger notifications at xxxxx
Sun Jun 30 11:48:08 UTC 2019


eht16 commented on this pull request.



>  void configuration_init(void)
 {
 	keyfile_groups = g_ptr_array_new();
 	pref_groups = g_ptr_array_new();
 	init_pref_groups();
+
+	g_signal_connect(geany_object, "document-new", G_CALLBACK(document_list_changed_cb), NULL);
+	g_signal_connect(geany_object, "document-open", G_CALLBACK(document_list_changed_cb), NULL);
+	g_signal_connect(geany_object, "document-save", G_CALLBACK(document_list_changed_cb), NULL);

> It would be nice to avoid saving the conf when saving a file in the common case, e.g. when just updating the file's content. AFAIK, we don't affect the session then, do we? My point is that I'm 

Hmm, I'm not sure if checking `doc->real_path` for `NULL` is sufficient, there might be more cases when we want to trigger the config save. Also, the `doc->real_path` check would have to differentiate cases like renaming and closing documents.
The config save process is pretty lightweight and, as said initially, very fast.
Users trying to reduce disk IO still can disable this feature.

Can we agree to implement more sophisticated checks independent of this PR afterwards if someone wants to?

> Why is document-new connected to? If there's no file yet it won't affect the session.

Removed in https://github.com/geany/geany/pull/2114/commits/d6ebff6c4f6c04786e5448735ac59462e2f7619a. Probably not necessary, I just added it for completeness.

-- 
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/pull/2114#discussion_r298830316
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190630/7eae36e7/attachment-0001.html>


More information about the Github-comments mailing list