diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-03-17 14:07:11 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-03-17 14:07:11 +0100 |
commit | 50477a0b99e893da8858fad0e0318b8d4e63b3a5 (patch) | |
tree | 218ff868618c6e36a387015b188ae6d10887bf2f /source/dialogs | |
parent | dfeb5940d4c447bb5c71104726ab416a04e6bfb4 (diff) |
[Keys] Cleanup view a bit.
Diffstat (limited to 'source/dialogs')
-rw-r--r-- | source/dialogs/combi.c | 18 | ||||
-rw-r--r-- | source/dialogs/drun.c | 6 | ||||
-rw-r--r-- | source/dialogs/ssh.c | 34 |
3 files changed, 29 insertions, 29 deletions
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c index 4da67f31..18d25813 100644 --- a/source/dialogs/combi.c +++ b/source/dialogs/combi.c @@ -204,22 +204,22 @@ static char * combi_mgrv ( const Mode *sw, unsigned int selected_line, int *stat } for ( unsigned i = 0; i < pd->num_switchers; i++ ) { if ( selected_line >= pd->starts[i] && selected_line < ( pd->starts[i] + pd->lengths[i] ) ) { - char * str = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE ); + char * str = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE ); const char *dname = mode_get_display_name ( pd->switchers[i].mode ); - char * retv = g_strdup_printf ( "%s %s", dname, str ); + char * retv = g_strdup_printf ( "%s %s", dname, str ); g_free ( str ); if ( attr_list != NULL ) { - ThemeWidget *wid = rofi_theme_find_widget ( sw->name, NULL, TRUE); - Property *p = rofi_theme_find_property ( wid, P_COLOR, pd->switchers[i].mode->name, TRUE); + ThemeWidget *wid = rofi_theme_find_widget ( sw->name, NULL, TRUE ); + Property *p = rofi_theme_find_property ( wid, P_COLOR, pd->switchers[i].mode->name, TRUE ); if ( p != NULL ) { PangoAttribute *pa = pango_attr_foreground_new ( - p->value.color.red * 65535, - p->value.color.green * 65535, - p->value.color.blue * 65535 ); + p->value.color.red * 65535, + p->value.color.green * 65535, + p->value.color.blue * 65535 ); pa->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING; - pa->end_index = strlen(dname); - *attr_list = g_list_append ( *attr_list, pa ); + pa->end_index = strlen ( dname ); + *attr_list = g_list_append ( *attr_list, pa ); } } return retv; diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c index ed7e5b51..639b2b39 100644 --- a/source/dialogs/drun.c +++ b/source/dialogs/drun.c @@ -69,7 +69,7 @@ typedef struct /* Generic Name */ char *generic_name; #ifdef GET_CAT_PARSE_TIME - char **categories; + char **categories; #endif GKeyFile *key_file; @@ -273,9 +273,9 @@ static void read_desktop_file ( DRunModePrivateData *pd, const char *root, const gchar *gn = g_key_file_get_locale_string ( kf, "Desktop Entry", "GenericName", NULL, NULL ); pd->entry_list[pd->cmd_list_length].generic_name = gn; #ifdef GET_CAT_PARSE_TIME - pd->entry_list[pd->cmd_list_length].categories= g_key_file_get_locale_string_list ( kf, "Desktop Entry", "Categories", NULL, NULL, NULL ); + pd->entry_list[pd->cmd_list_length].categories = g_key_file_get_locale_string_list ( kf, "Desktop Entry", "Categories", NULL, NULL, NULL ); #endif - pd->entry_list[pd->cmd_list_length].exec = g_key_file_get_string ( kf, "Desktop Entry", "Exec", NULL ); + pd->entry_list[pd->cmd_list_length].exec = g_key_file_get_string ( kf, "Desktop Entry", "Exec", NULL ); // Keep keyfile around. pd->entry_list[pd->cmd_list_length].key_file = kf; diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c index 0e9bca06..a332dd5f 100644 --- a/source/dialogs/ssh.c +++ b/source/dialogs/ssh.c @@ -50,12 +50,11 @@ #include "history.h" #include "dialogs/ssh.h" - /** * Log domain for the ssh modi. */ -#define LOG_DOMAIN "Dialogs.Ssh" +#define LOG_DOMAIN "Dialogs.Ssh" /** * Name of the history file where previously choosen hosts are stored. @@ -265,9 +264,9 @@ static char **read_hosts_file ( char ** retv, unsigned int *length ) static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned int *length, unsigned int num_favorites ) { - FILE *fd = fopen ( filename, "r" ); + FILE *fd = fopen ( filename, "r" ); - g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Parsing ssh config file: %s" , filename); + g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Parsing ssh config file: %s", filename ); if ( fd != NULL ) { char *buffer = NULL; size_t buffer_length = 0; @@ -286,22 +285,23 @@ static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned continue; } - if ( g_strcmp0 ( token, "Include") == 0 ) { + if ( g_strcmp0 ( token, "Include" ) == 0 ) { token = strtok_r ( NULL, SSH_TOKEN_DELIM, &strtok_pointer ); - g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found Include: %s" , token); - gchar *path = rofi_expand_path ( token ); + g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Found Include: %s", token ); + gchar *path = rofi_expand_path ( token ); gchar *full_path = NULL; - if ( ! g_path_is_absolute ( path ) ){ + if ( !g_path_is_absolute ( path ) ) { char *dirname = g_path_get_dirname ( filename ); full_path = g_build_filename ( dirname, path, NULL ); - g_free(dirname); - } else { + g_free ( dirname ); + } + else { full_path = g_strdup ( path ); } - glob_t globbuf = {0,}; + glob_t globbuf = { 0, }; - if ( glob ( full_path, 0, NULL, &globbuf ) == 0 ){ - for ( size_t iter = 0; iter < globbuf.gl_pathc; iter++){ + if ( glob ( full_path, 0, NULL, &globbuf ) == 0 ) { + for ( size_t iter = 0; iter < globbuf.gl_pathc; iter++ ) { parse_ssh_config_file ( globbuf.gl_pathv[iter], retv, length, num_favorites ); } } @@ -333,7 +333,7 @@ static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned // given num_favorites is max 25. int found = 0; for ( unsigned int j = 0; j < num_favorites; j++ ) { - if ( !g_ascii_strcasecmp ( token, (*retv)[j] ) ) { + if ( !g_ascii_strcasecmp ( token, ( *retv )[j] ) ) { found = 1; break; } @@ -344,9 +344,9 @@ static void parse_ssh_config_file ( const char *filename, char ***retv, unsigned } // Add this host name to the list. - (*retv) = g_realloc ( (*retv), ( ( *length ) + 2 ) * sizeof ( char* ) ); - (*retv)[( *length )] = g_strdup ( token ); - (*retv)[( *length ) + 1] = NULL; + ( *retv ) = g_realloc ( ( *retv ), ( ( *length ) + 2 ) * sizeof ( char* ) ); + ( *retv )[( *length )] = g_strdup ( token ); + ( *retv )[( *length ) + 1] = NULL; ( *length )++; } } |