After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652119 - Reduce bulk in ephy-main.c
Reduce bulk in ephy-main.c
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-08 15:02 UTC by Claudio Saavedra
Modified: 2011-08-23 16:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add ephy_string_commandline_args_to_uris() to ephy string utilities (4.45 KB, patch)
2011-06-08 15:02 UTC, Claudio Saavedra
committed Details | Review
Move the save/load accelerators methods to the ephy file utilities (3.45 KB, patch)
2011-06-08 15:02 UTC, Claudio Saavedra
committed Details | Review

Description Claudio Saavedra 2011-06-08 15:02:51 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.
Comment 1 Claudio Saavedra 2011-06-08 15:02:53 UTC
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.
Comment 2 Claudio Saavedra 2011-06-08 15:02:56 UTC
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
Comment 3 Xan Lopez 2011-06-08 15:53:28 UTC
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?
Comment 4 Xan Lopez 2011-06-08 15:57:21 UTC
Review of attachment 189476 [details] [review]:

r=me
Comment 5 Claudio Saavedra 2011-06-08 16:31:08 UTC
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!
Comment 6 Xan Lopez 2011-08-23 16:20:26 UTC
Closing this. I guess you can open more bugs if you do more cleanups in the future.