Commit ec419539 authored by Paolo Borelli's avatar Paolo Borelli Committed by Paolo Borelli

Use g_timeout_add_seconds. Bug #565127, patch by mail@paul.kishimoto.name.

2008-12-20  Paolo Borelli  <pborelli@katamail.com>

	* gedit/gedit-metadata-manager.c:
	* gedit/gedit-tab.c:
	Use g_timeout_add_seconds. Bug #565127, patch by
	mail@paul.kishimoto.name.


svn path=/trunk/; revision=6668
parent 279c4835
2008-12-20 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-metadata-manager.c:
* gedit/gedit-tab.c:
Use g_timeout_add_seconds. Bug #565127, patch by
mail@paul.kishimoto.name.
2008-12-20 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-tab.c:
......
......@@ -347,7 +347,7 @@ AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
GNOME_COMPILE_WARNINGS(yes)
AC_ARG_ENABLE(deprecations,
[AC_HELP_STRING([--enable-deprecations],
[AS_HELP_STRING([--enable-deprecations],
[warn about deprecated usages [default=no]])],,
[enable_deprecations=no])
......
......@@ -93,15 +93,15 @@ item_free (gpointer data)
static void
gedit_metadata_manager_arm_timeout (void)
{
if (gedit_metadata_manager->timeout_id)
return;
gedit_metadata_manager->timeout_id =
g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
2000, /* 2 sec */
(GSourceFunc)gedit_metadata_manager_save,
NULL,
NULL);
if (gedit_metadata_manager->timeout_id == 0)
{
gedit_metadata_manager->timeout_id =
g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE,
2,
(GSourceFunc)gedit_metadata_manager_save,
NULL,
NULL);
}
}
static gboolean
......
......@@ -115,11 +115,11 @@ install_auto_save_timeout (GeditTab *tab)
g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_SAVING_ERROR);
g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_SAVING_ERROR);
g_return_if_fail (tab->priv->state != GEDIT_TAB_STATE_REVERTING_ERROR);
/* Add a new timeout */
timeout = g_timeout_add (tab->priv->auto_save_interval * 1000 * 60,
(GSourceFunc) gedit_tab_auto_save,
tab);
timeout = g_timeout_add_seconds (tab->priv->auto_save_interval * 60,
(GSourceFunc) gedit_tab_auto_save,
tab);
tab->priv->auto_save_timeout = timeout;
}
......@@ -128,7 +128,7 @@ static gboolean
install_auto_save_timeout_if_needed (GeditTab *tab)
{
GeditDocument *doc;
gedit_debug (DEBUG_TAB);
g_return_val_if_fail (tab->priv->auto_save_timeout <= 0, FALSE);
......@@ -2120,18 +2120,18 @@ gedit_tab_auto_save (GeditTab *tab)
if ((tab->priv->state != GEDIT_TAB_STATE_NORMAL) &&
(tab->priv->state != GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW))
{
/* Retry after 15 seconds */
/* Retry after 30 seconds */
guint timeout;
gedit_debug_message (DEBUG_TAB, "Retry after 15 seconds");
gedit_debug_message (DEBUG_TAB, "Retry after 30 seconds");
/* Add a new timeout */
timeout = g_timeout_add (30 * 1000,
(GSourceFunc) gedit_tab_auto_save,
tab);
timeout = g_timeout_add_seconds (30,
(GSourceFunc) gedit_tab_auto_save,
tab);
tab->priv->auto_save_timeout = timeout;
/* Returns FALSE so the old timeout is "destroyed" */
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment