qulogic/libgnt

Save the world.

2009-04-05, Sadrul Habib Chowdhury
8df3e668ef6f
Parents 48d91345df06
Children 8cb19cdf9af6
Save the world.

Patch from Arunan Bala to save the world. But instead of saving the
cheerleader, he's using g_timeout_add_seconds where possible in place of
g_timeout_add. Closes #8831.
  • +4 -0
    gnt.h
  • +3 -3
    gnttree.c
  • +2 -2
    gntwm.c
  • --- a/gnt.h Sun Apr 05 08:22:22 2009 +0000
    +++ b/gnt.h Sun Apr 05 08:42:00 2009 +0000
    @@ -48,6 +48,10 @@
    #define G_PARAM_STATIC_BLURB G_PARAM_PRIVATE
    #endif
    +#if !GLIB_CHECK_VERSION(2,14,0)
    + #define g_timeout_add_seconds(time, callback, data) g_timeout_add(time * 1000, callback, data)
    +#endif
    +
    /**
    * Initialize GNT.
    */
    --- a/gnttree.c Sun Apr 05 08:22:22 2009 +0000
    +++ b/gnttree.c Sun Apr 05 08:42:00 2009 +0000
    @@ -28,7 +28,7 @@
    #include <string.h>
    #include <ctype.h>
    -#define SEARCH_TIMEOUT 4000 /* 4 secs */
    +#define SEARCH_TIMEOUT_S 4 /* 4 secs */
    #define SEARCHING(tree) (tree->priv->search && tree->priv->search->len > 0)
    #define COLUMN_INVISIBLE(tree, index) (tree->columns[index].flags & GNT_TREE_COLUMN_INVISIBLE)
    @@ -821,7 +821,7 @@
    gnt_bindable_perform_action_key(GNT_BINDABLE(tree), text);
    }
    g_source_remove(tree->priv->search_timeout);
    - tree->priv->search_timeout = g_timeout_add(SEARCH_TIMEOUT, search_timeout, tree);
    + tree->priv->search_timeout = g_timeout_add_seconds(SEARCH_TIMEOUT_S, search_timeout, tree);
    return TRUE;
    } else if (text[0] == ' ' && text[1] == 0) {
    /* Space pressed */
    @@ -933,7 +933,7 @@
    return FALSE;
    GNT_WIDGET_SET_FLAGS(GNT_WIDGET(tree), GNT_WIDGET_DISABLE_ACTIONS);
    tree->priv->search = g_string_new(NULL);
    - tree->priv->search_timeout = g_timeout_add(SEARCH_TIMEOUT, search_timeout, tree);
    + tree->priv->search_timeout = g_timeout_add_seconds(SEARCH_TIMEOUT_S, search_timeout, tree);
    return TRUE;
    }
    --- a/gntwm.c Sun Apr 05 08:22:22 2009 +0000
    +++ b/gntwm.c Sun Apr 05 08:42:00 2009 +0000
    @@ -408,7 +408,7 @@
    wm->positions = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
    if (gnt_style_get_bool(GNT_STYLE_REMPOS, TRUE))
    read_window_positions(wm);
    - g_timeout_add(IDLE_CHECK_INTERVAL * 1000, check_idle, NULL);
    + g_timeout_add_seconds(IDLE_CHECK_INTERVAL, check_idle, NULL);
    time(&last_active_time);
    gnt_wm_switch_workspace(wm, 0);
    }
    @@ -2130,7 +2130,7 @@
    if (write_timeout) {
    g_source_remove(write_timeout);
    }
    - write_timeout = g_timeout_add(10000, write_already, wm);
    + write_timeout = g_timeout_add_seconds(10, write_already, wm);
    }
    void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y)