SF.net SVN: geany:[3420] trunk/src/stash.c
ntrel at users.sourceforge.net
ntrel at xxxxx
Mon Dec 22 18:18:15 UTC 2008
Revision: 3420
http://geany.svn.sourceforge.net/geany/?rev=3420&view=rev
Author: ntrel
Date: 2008-12-22 18:18:14 +0000 (Mon, 22 Dec 2008)
Log Message:
-----------
Add comment note about why we use a GArray rather than having users
declare a static array.
Modified Paths:
--------------
trunk/src/stash.c
Modified: trunk/src/stash.c
===================================================================
--- trunk/src/stash.c 2008-12-22 17:13:37 UTC (rev 3419)
+++ trunk/src/stash.c 2008-12-22 18:18:14 UTC (rev 3420)
@@ -35,7 +35,20 @@
* String settings and other dynamically allocated settings must be initialized to NULL.
*/
+/* Implementation Note
+ * We use a GArray to hold prefs. It would be more efficient for user code to declare
+ * a static array of GeanyPrefEntry structs, but we don't do this because:
+ *
+ * * It would be more ugly (lots of casts and NULLs).
+ * * Less type checking.
+ * * The API would have to break when adding/changing fields.
+ *
+ * Usually the prefs code isn't what user code will spend most of its time doing, so this
+ * should be efficient enough. But, if desired we could add a stash_group_set_size() function
+ * to reduce reallocation.
+ * */
+
#include <gtk/gtk.h>
#include "stash.h"
@@ -567,6 +580,8 @@
}
+/* We could maybe also have something like stash_group_add_combo_box_entry_with_menu()
+ * for the history list - or should that be stored as a separate setting? */
void stash_group_add_combo_box_entry(GeanyPrefGroup *group, gchar **setting,
const gchar *key_name, const gchar *default_value, gpointer widget_id)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list