GApplication: menu can change after registration
authorRyan Lortie <desrt@desrt.ca>
Fri, 2 Dec 2011 20:17:56 +0000 (15:17 -0500)
committerRyan Lortie <desrt@desrt.ca>
Thu, 8 Dec 2011 23:05:14 +0000 (18:05 -0500)
Allow the menu to be changed after registration.  This is quite useful
for setting up the menus from the ::startup handler instead of having to
do it before registration because it lets you skip the work if you're
not the primary instance.

gio/gapplication.c

index 4f5c7b5..2337623 100644 (file)
@@ -472,9 +472,6 @@ g_application_set_action_group (GApplication *application,
  * If supported, the application menu will be rendered by the desktop
  * environment.
  *
- * It is an error to call this function after the application has been
- * registered.
- *
  * Since: 2.32
  */
 void
@@ -482,7 +479,6 @@ g_application_set_app_menu (GApplication *application,
                             GMenuModel   *app_menu)
 {
   g_return_if_fail (G_IS_APPLICATION (application));
-  g_return_if_fail (!application->priv->is_registered);
 
   if (app_menu != application->priv->app_menu)
     {
@@ -534,9 +530,6 @@ g_application_get_app_menu (GApplication *application)
  * example, the application menu may be rendered by the desktop shell
  * while the menubar (if set) remains in each individual window.
  *
- * It is an error to call this function after the application has been
- * registered.
- *
  * Since: 2.32
  */
 void
@@ -544,7 +537,6 @@ g_application_set_menubar (GApplication *application,
                             GMenuModel   *menubar)
 {
   g_return_if_fail (G_IS_APPLICATION (application));
-  g_return_if_fail (!application->priv->is_registered);
 
   if (menubar != application->priv->menubar)
     {