Commit 6bfeca81 authored by Dave Davenport's avatar Dave Davenport

Don't print description if it is null

parent 2cacadff
......@@ -46,14 +46,14 @@ G_MODULE_EXPORT Mode mode;
*/
typedef struct
{
GList *array;
GList *array;
unsigned int array_length;
} GRUNModePrivateData;
static void get_grun ( Mode *sw )
{
/**
/**
* Get the entries to display.
* this gets called on plugin initialization.
*/
......@@ -126,15 +126,20 @@ static char *_get_display_value ( const Mode *sw, unsigned int selected_line, G_
{
GAppInfo *app = g_list_nth_data(pd->array, selected_line);
if ( app ) {
*state |= MARKUP;
return g_markup_printf_escaped("%s <span weight='light' size='small'><i>(%s)</i></span>", g_app_info_get_name(app), g_app_info_get_description(app));
*state |= MARKUP;
const char *description = g_app_info_get_description ( app );
if ( description ) {
return g_markup_printf_escaped("%s <span weight='light' size='small'><i>(%s)</i></span>", g_app_info_get_name(app), description );
} else {
return g_strdup ( g_app_info_get_name ( app ) );
}
} else {
return g_strdup ( "Not found." );
}
}
// Only return the string if requested, otherwise only set state.
return NULL;
return NULL;
}
/**
......
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