panel-loader: Cosmetic changes

This commit only fixes some very minor cosmetic changes
like int → gint, simplifies the code by using g_autofoo,
et cetera.

https://bugzilla.gnome.org/show_bug.cgi?id=779216
This commit is contained in:
Georges Basile Stavracas Neto 2017-07-24 23:21:44 -03:00
parent 6cf52ada03
commit b4194048de

View file

@ -123,9 +123,9 @@ cc_panel_loader_get_panels (void)
static int
parse_categories (GDesktopAppInfo *app)
{
const char *categories;
char **split;
int retval;
GStrv split;
const gchar *categories;
gint retval;
categories = g_desktop_app_info_get_categories (app);
split = g_strsplit (categories, ";", -1);
@ -175,23 +175,21 @@ parse_categories (GDesktopAppInfo *app)
void
cc_panel_loader_fill_model (CcShellModel *model)
{
int i;
guint i;
for (i = 0; i < G_N_ELEMENTS (all_panels); i++)
{
GDesktopAppInfo *app;
char *desktop_name;
int category;
g_autoptr (GDesktopAppInfo) app;
g_autofree gchar *desktop_name = NULL;
gint category;
desktop_name = g_strconcat ("gnome-", all_panels[i].name,
"-panel.desktop", NULL);
app = g_desktop_app_info_new (desktop_name);
g_free (desktop_name);
if (app == NULL)
if (!app)
{
g_warning ("Ignoring broken panel %s (missing desktop file)",
all_panels[i].name);
g_warning ("Ignoring broken panel %s (missing desktop file)", all_panels[i].name);
continue;
}
@ -204,8 +202,6 @@ cc_panel_loader_fill_model (CcShellModel *model)
*/
if (category != CC_CATEGORY_HIDDEN)
cc_shell_model_add_item (model, category, G_APP_INFO (app), all_panels[i].name);
g_object_unref (app);
}
}