Commit 5de566dc authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

menu: move get_applications_menu to utils file

parent 6acabf00
Pipeline #30768 failed with stage
in 2 minutes and 28 seconds
......@@ -78,18 +78,6 @@ button_press_event_cb (GtkWidget *widget,
return TRUE;
}
static gchar *
get_applications_menu (void)
{
const gchar *xdg_menu_prefx;
xdg_menu_prefx = g_getenv ("XDG_MENU_PREFIX");
if (!xdg_menu_prefx || *xdg_menu_prefx == '\0')
return g_strdup ("gnome-applications.menu");
return g_strdup_printf ("%sapplications.menu", xdg_menu_prefx);
}
static gchar *
get_settings_menu (void)
{
......@@ -136,7 +124,7 @@ append_applications_item (GpMenuBarApplet *applet)
tooltip = _("Browse and run installed applications");
gtk_widget_set_tooltip_text (applet->applications_item, tooltip);
menu = get_applications_menu ();
menu = gp_menu_utils_get_applications_menu ();
applet->applications_menu = gp_menu_new (GP_APPLET (applet), menu, TRUE);
g_free (menu);
......
......@@ -232,18 +232,6 @@ split_menu_uri (const gchar *menu_uri,
return g_strdup (p);
}
static gchar *
get_applications_menu (void)
{
const gchar *xdg_menu_prefx;
xdg_menu_prefx = g_getenv ("XDG_MENU_PREFIX");
if (!xdg_menu_prefx || *xdg_menu_prefx == '\0')
return g_strdup ("gnome-applications.menu");
return g_strdup_printf ("%sapplications.menu", xdg_menu_prefx);
}
static void
menu_icon_size_cb (GpApplet *applet,
GParamSpec *pspec,
......@@ -334,7 +322,7 @@ validate_scheme (const gchar *scheme,
{
if (g_strcmp0 (scheme, "applications") == 0)
{
*menu_file = get_applications_menu ();
*menu_file = gp_menu_utils_get_applications_menu ();
return TRUE;
}
else if (g_strcmp0 (scheme, "gnomecc") == 0)
......@@ -390,7 +378,7 @@ update_menu (GpMenuButtonApplet *menu_button)
{
gchar *menu_file;
menu_file = get_applications_menu ();
menu_file = gp_menu_utils_get_applications_menu ();
priv->menu = gp_menu_new (GP_APPLET (menu_button), menu_file, TRUE);
g_free (menu_file);
......
......@@ -477,6 +477,18 @@ gp_menu_utils_get_user_name (void)
return user_name;
}
gchar *
gp_menu_utils_get_applications_menu (void)
{
const gchar *xdg_menu_prefx;
xdg_menu_prefx = g_getenv ("XDG_MENU_PREFIX");
if (!xdg_menu_prefx || *xdg_menu_prefx == '\0')
return g_strdup ("gnome-applications.menu");
return g_strdup_printf ("%sapplications.menu", xdg_menu_prefx);
}
void
append_separator_if_needed (GtkMenu *menu)
{
......
......@@ -39,6 +39,8 @@ void gp_menu_utils_show_error_dialog (const gchar *message,
gchar *gp_menu_utils_get_user_name (void);
gchar *gp_menu_utils_get_applications_menu (void);
void append_separator_if_needed (GtkMenu *menu);
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment