summaryrefslogtreecommitdiffstats
path: root/source/dialogs
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-08 21:36:06 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-08 21:36:06 +0100
commitbaab2047adf24642cbc727b50a77dc544e934a76 (patch)
treef9437dda9ae91d4e59b67231eec2cb3b51a1fe93 /source/dialogs
parent8c0c43952dceb78d717f036478b4d66c75267a3b (diff)
Indent magic, rework makefile so lexer and yacc file are not passed.
Diffstat (limited to 'source/dialogs')
-rw-r--r--source/dialogs/dmenu.c14
-rw-r--r--source/dialogs/drun.c12
-rw-r--r--source/dialogs/script.c2
-rw-r--r--source/dialogs/ssh.c2
-rw-r--r--source/dialogs/window.c17
5 files changed, 24 insertions, 23 deletions
diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c
index 3e5aaa66..d53e829c 100644
--- a/source/dialogs/dmenu.c
+++ b/source/dialogs/dmenu.c
@@ -137,21 +137,23 @@ static void async_read_callback ( GObject *source_object, GAsyncResult *res, gpo
g_data_input_stream_read_upto_async ( pd->data_input_stream, &( pd->separator ), 1, G_PRIORITY_LOW, pd->cancel,
async_read_callback, pd );
return;
- } else {
+ }
+ else {
GError *error = NULL;
// Absorb separator, already in buffer so should not block.
// If error == NULL end of stream..
- g_data_input_stream_read_byte ( stream, NULL, &error);
+ g_data_input_stream_read_byte ( stream, NULL, &error );
if ( error == NULL ) {
// Add empty line.
- read_add ( pd, "", 0);
+ read_add ( pd, "", 0 );
rofi_view_reload ();
g_data_input_stream_read_upto_async ( pd->data_input_stream, &( pd->separator ), 1, G_PRIORITY_LOW, pd->cancel,
- async_read_callback, pd );
+ async_read_callback, pd );
return;
- } else {
- g_error_free (error);
+ }
+ else {
+ g_error_free ( error );
}
}
if ( !g_cancellable_is_cancelled ( pd->cancel ) ) {
diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c
index 4d07a1b6..5aa4dac7 100644
--- a/source/dialogs/drun.c
+++ b/source/dialogs/drun.c
@@ -192,7 +192,7 @@ static void exec_cmd_entry ( DRunModeEntry *e )
fprintf ( stderr, "Nothing to execute after processing: %s.\n", e->exec );;
return;
}
- gchar *fp = rofi_expand_path ( g_strstrip ( str ) );
+ gchar *fp = rofi_expand_path ( g_strstrip ( str ) );
gchar *exec_path = g_key_file_get_string ( e->key_file, "Desktop Entry", "Path", NULL );
if ( execsh ( exec_path, fp, e->terminal ) ) {
char *path = g_build_filename ( cache_dir, DRUN_CACHE_FILE, NULL );
@@ -539,12 +539,12 @@ static int drun_token_match ( const Mode *data, GRegex **tokens, unsigned int in
test = 1;
}
// Match against category.
- if ( !test ){
- gchar **list = g_key_file_get_locale_string_list ( rmpd->entry_list[index].key_file, "Desktop Entry", "Categories" , NULL, NULL,NULL );
- for ( int iter = 0; !test && list && list[iter]; iter++){
- test = token_match ( ftokens, list[iter]);
+ if ( !test ) {
+ gchar **list = g_key_file_get_locale_string_list ( rmpd->entry_list[index].key_file, "Desktop Entry", "Categories", NULL, NULL, NULL );
+ for ( int iter = 0; !test && list && list[iter]; iter++ ) {
+ test = token_match ( ftokens, list[iter] );
}
- g_strfreev(list);
+ g_strfreev ( list );
}
if ( test == 0 ) {
match = 0;
diff --git a/source/dialogs/script.c b/source/dialogs/script.c
index 86cd8bb5..2b018ff6 100644
--- a/source/dialogs/script.c
+++ b/source/dialogs/script.c
@@ -146,7 +146,7 @@ static ModeMode script_mode_result ( Mode *sw, int mretv, char **input, unsigned
rmpd->cmd_list = new_list;
rmpd->cmd_list_length = new_length;
- retv = RESET_DIALOG;
+ retv = RESET_DIALOG;
}
return retv;
}
diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c
index c0ba2f8c..8cfe68fd 100644
--- a/source/dialogs/ssh.c
+++ b/source/dialogs/ssh.c
@@ -198,7 +198,7 @@ static char **read_hosts_file ( char ** retv, unsigned int *length )
// Reading one line per time.
while ( getline ( &buffer, &buffer_length, fd ) > 0 ) {
// Evaluate one line.
- unsigned int index = 0, ti = 0;
+ unsigned int index = 0, ti = 0;
char *token = buffer;
// Tokenize it.
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 0c779928..5e9d3be3 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -399,13 +399,12 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
// Check if we are in I3 mode. I3 has to be special and allow markup in it window name......
char *i3_socket_path = window_get_text_prop ( xcb_stuff_get_root_window ( xcb ), netatoms[I3_SOCKET_PATH] );
- if ( i3_socket_path != NULL ){
- g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Detected I3 Window manager running.");
+ if ( i3_socket_path != NULL ) {
+ g_log ( LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "Detected I3 Window manager running." );
pd->i3_mode = TRUE;
g_free ( i3_socket_path );
}
-
// Create cache
x11_cache_create ();
@@ -488,15 +487,15 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
if ( has_names ) {
if ( pd->i3_mode ) {
char *output = NULL;
- if (pango_parse_markup ( _window_name_list_entry ( names.strings, names.strings_len,
- c->wmdesktop ),-1, 0, NULL, &output, NULL, NULL)){
+ if ( pango_parse_markup ( _window_name_list_entry ( names.strings, names.strings_len,
+ c->wmdesktop ), -1, 0, NULL, &output, NULL, NULL ) ) {
c->wmdesktopstr = output;
}
else {
- c->wmdesktopstr = g_strdup ( "Invalid name");
+ c->wmdesktopstr = g_strdup ( "Invalid name" );
}
-
- } else {
+ }
+ else {
c->wmdesktopstr = g_strdup ( _window_name_list_entry ( names.strings, names.strings_len, c->wmdesktop ) );
}
}
@@ -634,7 +633,7 @@ static ModeMode window_mode_result ( Mode *sw, int mretv, G_GNUC_UNUSED char **i
}
}
else if ( ( mretv & ( MENU_ENTRY_DELETE ) ) == MENU_ENTRY_DELETE ) {
- xcb_ewmh_request_close_window ( &(xcb->ewmh), xcb->screen_nbr, rmpd->ids->array[selected_line], XCB_CURRENT_TIME, XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER);
+ xcb_ewmh_request_close_window ( &( xcb->ewmh ), xcb->screen_nbr, rmpd->ids->array[selected_line], XCB_CURRENT_TIME, XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER );
xcb_flush ( xcb->connection );
}
return retv;