mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-18 13:54:36 -05:00
Indent files.
This commit is contained in:
parent
6ba31683c6
commit
9ae62960c1
20 changed files with 144 additions and 150 deletions
|
@ -316,7 +316,6 @@ gboolean helper_execute_command ( const char *wd, const char *cmd, gboolean run_
|
|||
*/
|
||||
cairo_surface_t *cairo_image_surface_create_from_svg ( const gchar* file, int height );
|
||||
|
||||
|
||||
/**
|
||||
* Ranges.
|
||||
*/
|
||||
|
|
|
@ -216,7 +216,6 @@ typedef struct Property
|
|||
PropertyValue value;
|
||||
} Property;
|
||||
|
||||
|
||||
/**
|
||||
* Structure to hold a range.
|
||||
*/
|
||||
|
@ -226,11 +225,11 @@ typedef struct rofi_range_pair
|
|||
unsigned int stop;
|
||||
} rofi_range_pair;
|
||||
|
||||
|
||||
/**
|
||||
* Internal structure for matching.
|
||||
*/
|
||||
typedef struct rofi_int_matcher_t {
|
||||
typedef struct rofi_int_matcher_t
|
||||
{
|
||||
GRegex *regex;
|
||||
gboolean invert;
|
||||
} rofi_int_matcher;
|
||||
|
|
|
@ -162,7 +162,6 @@ int rofi_theme_get_integer ( const widget *widget, const char *property, int
|
|||
*/
|
||||
int rofi_theme_get_position ( const widget *widget, const char *property, int def );
|
||||
|
||||
|
||||
/**
|
||||
* @param widget The widget to query
|
||||
* @param property The property to query.
|
||||
|
@ -288,7 +287,6 @@ GList *rofi_theme_get_list ( const widget *widget, const char * property, const
|
|||
*/
|
||||
gboolean rofi_theme_is_empty ( void );
|
||||
|
||||
|
||||
/**
|
||||
* Reset the current theme.
|
||||
*/
|
||||
|
|
|
@ -200,8 +200,6 @@ static unsigned int dmenu_mode_get_num_entries ( const Mode *sw )
|
|||
return rmpd->cmd_list_length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static gchar * dmenu_format_output_string ( const DmenuModePrivateData *pd, const char *input )
|
||||
{
|
||||
if ( pd->columns == NULL ) {
|
||||
|
|
|
@ -325,7 +325,8 @@ static gboolean read_desktop_file ( DRunModePrivateData *pd, const char *root, c
|
|||
if ( G_UNLIKELY ( pd->cmd_list_length > INT_MAX ) ) {
|
||||
// Default to smallest value.
|
||||
pd->entry_list[pd->cmd_list_length].sort_index = INT_MIN;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
pd->entry_list[pd->cmd_list_length].sort_index = -pd->cmd_list_length;
|
||||
}
|
||||
pd->entry_list[pd->cmd_list_length].icon_size = 0;
|
||||
|
@ -444,7 +445,8 @@ static void get_apps_history ( DRunModePrivateData *pd )
|
|||
unsigned int sort_index = length - index;
|
||||
if ( G_LIKELY ( sort_index < INT_MAX ) ) {
|
||||
pd->entry_list[i].sort_index = sort_index;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// This won't sort right anymore, but never gonna hit it anyway.
|
||||
pd->entry_list[i].sort_index = INT_MAX;
|
||||
}
|
||||
|
@ -494,7 +496,6 @@ static void get_apps ( DRunModePrivateData *pd )
|
|||
TICK_N ( "Get Desktop apps (system dirs)" );
|
||||
get_apps_history ( pd );
|
||||
|
||||
|
||||
g_qsort_with_data ( pd->entry_list, pd->cmd_list_length, sizeof ( DRunModeEntry ), drun_int_sort_list, NULL );
|
||||
|
||||
TICK_N ( "Sorting done." );
|
||||
|
|
|
@ -63,7 +63,6 @@ typedef struct
|
|||
char *message;
|
||||
char *prompt;
|
||||
gboolean do_markup;
|
||||
|
||||
} ScriptModePrivateData;
|
||||
|
||||
static void parse_header_entry ( Mode *sw, char *line, ssize_t length )
|
||||
|
@ -74,30 +73,30 @@ static void parse_header_entry ( Mode *sw, char *line, ssize_t length )
|
|||
length_key++;
|
||||
}
|
||||
|
||||
if ( length_key < length )
|
||||
{
|
||||
if ( length_key < length ) {
|
||||
line[length_key] = '\0';
|
||||
char *value = line + length_key + 1;
|
||||
if ( strcasecmp ( line, "message" ) == 0 ) {
|
||||
g_free ( pd->message );
|
||||
pd->message = g_strdup ( value );
|
||||
} else if ( strcasecmp ( line, "prompt" ) == 0 ) {
|
||||
}
|
||||
else if ( strcasecmp ( line, "prompt" ) == 0 ) {
|
||||
g_free ( pd->prompt );
|
||||
pd->prompt = g_strdup ( value );
|
||||
sw->display_name = pd->prompt;
|
||||
} else if ( strcasecmp ( line, "markup-rows" ) == 0 ) {
|
||||
}
|
||||
else if ( strcasecmp ( line, "markup-rows" ) == 0 ) {
|
||||
pd->do_markup = ( strcasecmp ( value, "true" ) == 0 );
|
||||
} else if ( strcasecmp ( line, "urgent" ) == 0 ) {
|
||||
}
|
||||
else if ( strcasecmp ( line, "urgent" ) == 0 ) {
|
||||
parse_ranges ( value, &( pd->urgent_list ), &( pd->num_urgent_list ) );
|
||||
} else if ( strcasecmp ( line, "active" ) == 0 ) {
|
||||
}
|
||||
else if ( strcasecmp ( line, "active" ) == 0 ) {
|
||||
parse_ranges ( value, &( pd->active_list ), &( pd->num_active_list ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static char **get_script_output ( Mode *sw, char *command, char *arg, unsigned int *length )
|
||||
{
|
||||
size_t actual_size = 0;
|
||||
|
@ -134,7 +133,8 @@ static char **get_script_output ( Mode *sw, char *command, char *arg, unsigned i
|
|||
}
|
||||
if ( buffer[0] == '\0' ) {
|
||||
parse_header_entry ( sw, &buffer[1], read_length - 1 );
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
if ( actual_size < ( ( *length ) + 2 ) ) {
|
||||
actual_size += 256;
|
||||
retv = g_realloc ( retv, ( actual_size ) * sizeof ( char* ) );
|
||||
|
@ -172,7 +172,6 @@ static void script_switcher_free ( Mode *sw )
|
|||
g_free ( sw );
|
||||
}
|
||||
|
||||
|
||||
static int script_mode_init ( Mode *sw )
|
||||
{
|
||||
if ( sw->private_data == NULL ) {
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
#include "rofi.h"
|
||||
#include "view.h"
|
||||
|
||||
|
||||
/**
|
||||
* Textual description of positioning rofi.
|
||||
*/
|
||||
|
@ -158,7 +157,6 @@ void helper_tokenize_free ( rofi_int_matcher ** tokens )
|
|||
for ( size_t i = 0; tokens && tokens[i]; i++ ) {
|
||||
g_regex_unref ( (GRegex *) tokens[i]->regex );
|
||||
g_free ( tokens[i] );
|
||||
|
||||
}
|
||||
g_free ( tokens );
|
||||
}
|
||||
|
@ -415,7 +413,9 @@ PangoAttrList *helper_token_match_get_pango_attr ( RofiHighlightColorStyle th, r
|
|||
if ( tokens ) {
|
||||
for ( int j = 0; tokens[j]; j++ ) {
|
||||
GMatchInfo *gmi = NULL;
|
||||
if ( tokens[j]->invert ) continue;
|
||||
if ( tokens[j]->invert ) {
|
||||
continue;
|
||||
}
|
||||
g_regex_match ( tokens[j]->regex, input, G_REGEX_MATCH_PARTIAL, &gmi );
|
||||
while ( g_match_info_matches ( gmi ) ) {
|
||||
int count = g_match_info_get_match_count ( gmi );
|
||||
|
|
|
@ -107,8 +107,7 @@ static _element ** __history_get_element_list ( FILE *fd, unsigned int *length )
|
|||
if ( ( l - ( start - buffer ) ) < 2 ) {
|
||||
continue;
|
||||
}
|
||||
if ( real_length < (*length+2) )
|
||||
{
|
||||
if ( real_length < ( *length + 2 ) ) {
|
||||
real_length += 15;
|
||||
// Resize and check.
|
||||
retv = g_realloc ( retv, ( real_length ) * sizeof ( _element* ) );
|
||||
|
|
|
@ -79,7 +79,8 @@ Property* rofi_theme_property_copy ( Property *p)
|
|||
Property *retv = rofi_theme_property_create ( p->type );
|
||||
retv->name = g_strdup ( p->name );
|
||||
|
||||
switch ( p->type ) {
|
||||
switch ( p->type )
|
||||
{
|
||||
case P_STRING:
|
||||
retv->value.s = g_strdup ( p->value.s );
|
||||
break;
|
||||
|
@ -677,7 +678,8 @@ GList *rofi_theme_get_list ( const widget *widget, const char * property, const
|
|||
if ( widget->parent ) {
|
||||
return rofi_theme_get_list ( widget->parent, property, defaults );
|
||||
}
|
||||
} else if ( p->type == P_LIST ) {
|
||||
}
|
||||
else if ( p->type == P_LIST ) {
|
||||
return g_list_copy_deep ( p->value.list, (GCopyFunc) g_strdup, NULL );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -182,7 +182,6 @@ textbox* textbox_create ( widget *parent, WidgetType type, const char *name, Tex
|
|||
tb->layout = pango_layout_new ( p_context );
|
||||
textbox_font ( tb, tbft );
|
||||
|
||||
|
||||
textbox_initialize_font ( tb );
|
||||
|
||||
if ( ( tb->flags & TB_ICON ) != TB_ICON ) {
|
||||
|
|
Loading…
Reference in a new issue