GNOME Bugzilla – Bug 652119
Reduce bulk in ephy-main.c
Last modified: 2011-08-23 16:20:26 UTC
In order to make a clean migration to GtkApplication, much of the code that is executed directly from epiphany's main() needs to be executed instead from some of the GtkApplication methods. At the moment, doing a clean migration to GtkApplication is hard, given the bulk in main(), which is about 400 lines and includes also calls to other methods statically defined in ephy-main.c. This bug attempts to clean up a bit the story here, by moving code in main() to utility functions, moving some general purpose methods to ephy-utils.c, and so on. It is hard to say yet how much movement will be done here, but the less we leave in main() and ephy-main.c, the easier the migration to GtkApplication will be. Attached go the first two trivial patches.
Created attachment 189475 [details] [review] Add ephy_string_commandline_args_to_uris() to ephy string utilities This is the first patch in an attempt to simplify epiphany's main() method, which is quite bulky by now.
Created attachment 189476 [details] [review] Move the save/load accelerators methods to the ephy file utilities Second patch in an attempt to clean up ephy-main.c
Review of attachment 189475 [details] [review]: ::: lib/ephy-string.c @@ +518,3 @@ + return NULL; + + args = g_malloc0 (sizeof (gchar *) * g_strv_length (arguments)); If this is a NULL-terminated array I suppose you need a + 1 there?
Review of attachment 189476 [details] [review]: r=me
Attachment 189475 [details] pushed as 8208832 - Add ephy_string_commandline_args_to_uris() to ephy string utilities Attachment 189476 [details] pushed as 769cf77 - Move the save/load accelerators methods to the ephy file utilities Thanks!
Closing this. I guess you can open more bugs if you do more cleanups in the future.