if (fputs (content, file) == EOF)
return FALSE;
+#ifndef G_OS_WIN32
fsync (fd);
+#endif
rewind (file);
return TRUE;
static gboolean
egg_recent_model_changed_timeout (EggRecentModel *model)
{
+ model->priv->changed_timeout = 0;
+
egg_recent_model_changed (model);
return FALSE;
static gboolean
egg_recent_model_lock_file (FILE *file)
{
+#ifdef F_TLOCK
int fd;
gint try = 5;
}
return FALSE;
+#else
+ return TRUE;
+#endif
}
static gboolean
egg_recent_model_unlock_file (FILE *file)
{
+#ifdef F_TLOCK
int fd;
rewind (file);
fd = fileno (file);
return (lockf (fd, F_ULOCK, 0) == 0) ? TRUE : FALSE;
+#else
+ return TRUE;
+#endif
}
static void
{
EggRecentModel *model = EGG_RECENT_MODEL (object);
+ if (model->priv->changed_timeout > 0) {
+ g_source_remove (model->priv->changed_timeout);
+ }
+
egg_recent_model_monitor (model, FALSE);