Introduce and use fe_timeout_add_seconds
This should allow the operating system to be a bit more lax about timeouts, allowing more efficient power management.
This commit is contained in:
parent
25e197a6c8
commit
bcbe42dd7a
|
@ -2234,7 +2234,7 @@ new_dcc (void)
|
||||||
dcc_list = g_slist_prepend (dcc_list, dcc);
|
dcc_list = g_slist_prepend (dcc_list, dcc);
|
||||||
if (timeout_timer == 0)
|
if (timeout_timer == 0)
|
||||||
{
|
{
|
||||||
timeout_timer = fe_timeout_add (1000, dcc_check_timeouts, NULL);
|
timeout_timer = fe_timeout_add_seconds (1, dcc_check_timeouts, NULL);
|
||||||
}
|
}
|
||||||
return dcc;
|
return dcc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ void fe_main (void);
|
||||||
void fe_cleanup (void);
|
void fe_cleanup (void);
|
||||||
void fe_exit (void);
|
void fe_exit (void);
|
||||||
int fe_timeout_add (int interval, void *callback, void *userdata);
|
int fe_timeout_add (int interval, void *callback, void *userdata);
|
||||||
|
int fe_timeout_add_seconds (int interval, void *callback, void *userdata);
|
||||||
void fe_timeout_remove (int tag);
|
void fe_timeout_remove (int tag);
|
||||||
void fe_new_window (struct session *sess, int focus);
|
void fe_new_window (struct session *sess, int focus);
|
||||||
void fe_new_server (struct server *serv);
|
void fe_new_server (struct server *serv);
|
||||||
|
|
|
@ -395,14 +395,14 @@ irc_init (session *sess)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (prefs.hex_notify_timeout)
|
if (prefs.hex_notify_timeout)
|
||||||
notify_tag = fe_timeout_add (prefs.hex_notify_timeout * 1000,
|
notify_tag = fe_timeout_add_seconds (prefs.hex_notify_timeout,
|
||||||
notify_checklist, NULL);
|
notify_checklist, NULL);
|
||||||
|
|
||||||
fe_timeout_add (prefs.hex_away_timeout * 1000, away_check, NULL);
|
fe_timeout_add_seconds (prefs.hex_away_timeout, away_check, NULL);
|
||||||
if (prefs.hex_gui_lagometer)
|
if (prefs.hex_gui_lagometer)
|
||||||
{
|
{
|
||||||
fe_timeout_add (500, hexchat_lag_check_update, NULL);
|
fe_timeout_add (500, hexchat_lag_check_update, NULL);
|
||||||
fe_timeout_add (30000, hexchat_lag_check, NULL);
|
fe_timeout_add_seconds (30, hexchat_lag_check, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg_url != NULL)
|
if (arg_url != NULL)
|
||||||
|
|
|
@ -410,7 +410,7 @@ flood_check (char *nick, char *ip, server *serv, session *sess, int what) /*0=ct
|
||||||
{
|
{
|
||||||
prefs.hex_gui_autoopen_dialog = 0;
|
prefs.hex_gui_autoopen_dialog = 0;
|
||||||
/* turn it back on in 30 secs */
|
/* turn it back on in 30 secs */
|
||||||
fe_timeout_add (30000, flood_autodialog_timeout, NULL);
|
fe_timeout_add_seconds (30, flood_autodialog_timeout, NULL);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1594,7 +1594,7 @@ inbound_login_end (session *sess, char *text, const message_tags_data *tags_data
|
||||||
&& ((((ircnet *)serv->network)->pass && inbound_nickserv_login (serv))
|
&& ((((ircnet *)serv->network)->pass && inbound_nickserv_login (serv))
|
||||||
|| ((ircnet *)serv->network)->commandlist))
|
|| ((ircnet *)serv->network)->commandlist))
|
||||||
{
|
{
|
||||||
serv->joindelay_tag = fe_timeout_add (prefs.hex_irc_join_delay * 1000, check_autojoin_channels, serv);
|
serv->joindelay_tag = fe_timeout_add_seconds (prefs.hex_irc_join_delay, check_autojoin_channels, serv);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -249,7 +249,7 @@ static void
|
||||||
close_socket (int sok)
|
close_socket (int sok)
|
||||||
{
|
{
|
||||||
/* close the socket in 5 seconds so the QUIT message is not lost */
|
/* close the socket in 5 seconds so the QUIT message is not lost */
|
||||||
fe_timeout_add (5000, close_socket_cb, GINT_TO_POINTER (sok));
|
fe_timeout_add_seconds (5, close_socket_cb, GINT_TO_POINTER (sok));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle 1 line of text received from the server */
|
/* handle 1 line of text received from the server */
|
||||||
|
|
|
@ -345,6 +345,12 @@ fe_timeout_add (int interval, void *callback, void *userdata)
|
||||||
return g_timeout_add (interval, (GSourceFunc) callback, userdata);
|
return g_timeout_add (interval, (GSourceFunc) callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fe_timeout_add_seconds (int interval, void *callback, void *userdata)
|
||||||
|
{
|
||||||
|
return g_timeout_add_seconds (interval, (GSourceFunc) callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fe_timeout_remove (int tag)
|
fe_timeout_remove (int tag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -415,6 +415,12 @@ fe_timeout_add (int interval, void *callback, void *userdata)
|
||||||
return g_timeout_add (interval, (GSourceFunc) callback, userdata);
|
return g_timeout_add (interval, (GSourceFunc) callback, userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
fe_timeout_add_seconds (int interval, void *callback, void *userdata)
|
||||||
|
{
|
||||||
|
return g_timeout_add_seconds (interval, (GSourceFunc) callback, userdata);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
fe_input_remove (int tag)
|
fe_input_remove (int tag)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue