Use g_timeout_add_seconds instead g_timeout_add
The calls to g_timeout_add are replaced with g_timeout_add_seconds to reduce the number or program wake ups. See the GNOME Goal description: http://live.gnome.org/GnomeGoals/UseTimeoutAddSeconds
This commit is contained in:
parent
bda85194a8
commit
1570a2bbf0
@ -85,7 +85,7 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
g_object_unref (builder);
|
||||
|
@ -129,7 +129,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
@ -136,7 +136,7 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
@ -138,7 +138,7 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
g_object_unref (builder);
|
||||
|
@ -292,7 +292,7 @@ zenity_notification (ZenityData *data, ZenityNotificationData *notification_data
|
||||
gtk_status_icon_set_visible (status_icon, TRUE);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
@ -286,7 +286,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
|
||||
zenity_progress_read_info (progress_data);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
@ -92,7 +92,7 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
g_object_unref (builder);
|
||||
|
@ -152,7 +152,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
|
||||
g_object_unref (builder);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
@ -499,7 +499,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
|
||||
zenity_util_show_dialog (dialog);
|
||||
|
||||
if(data->timeout_delay > 0) {
|
||||
g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
|
||||
}
|
||||
|
||||
gtk_main ();
|
||||
|
Reference in New Issue
Block a user