Code review comment for lp:~elementary-apps/pantheon-mail/granite-about

Revision history for this message
Mike Seese (seesemichaelj) wrote :

Below is concerning the startup() call at line 117 in geary-application.vala proposed in revision 1969.

Technically, you only need to do a Gdk.init(). Gtk.init() calls Gdk.init() and Gtk.Application.startup() calls Gtk.init() and GearyApplication.startup() calls Gtk.Application.startup().

We just need to enforce that gdk gets initialized.

Gtk.Application.startup() only gets called if there is no other instance of the application. The startup signal is sent during register(). If a primary instance already exists, register() returns true but does not perform any work (see http://www.valadoc.org/#!api=gio-2.0/GLib.Application.register).
I have verified this by putting breakpoints in geary-application.vala lines 117 and 135. If register() called startup(), line 135 would be executed first, otherwise 117 would be. 117 was executed first.

Anyway, going back to the question at hand: is calling "startup()" okay even though another instance exists? I'm unsure of the other functions in GearyApplication.startup(), but they do not seem to be detrimental if called an extra time. Thus I approve the code, but we should keep this in the back our mind if future issues exist concerning starting Mail while Mail is already running (i.e. geary --about or just geary).

review: Approve (code)

« Back to merge proposal