~ubuntu-branches/ubuntu/quantal/gconf/quantal

« back to all changes in this revision

Viewing changes to backends/markup-backend.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-08-19 13:42:30 UTC
  • mto: (7.2.1 sid) (1.2.1) (76.1.1 oneiric-proposed)
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20080819134230-65832cyama90mbk6
Tags: upstream-2.23.2
ImportĀ upstreamĀ versionĀ 2.23.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Boston, MA 02111-1307, USA.
18
18
 */
19
19
 
20
 
 
21
 
#include <gconf/gconf-backend.h>
22
 
#include <gconf/gconf-internals.h>
23
 
#include <gconf/gconf.h>
 
20
#include "config.h"
 
21
#include "gconf/gconf-backend.h"
 
22
#include "gconf/gconf-internals.h"
 
23
#include "gconf/gconf.h"
24
24
 
25
25
#include <stdio.h>
26
26
#include <time.h>
59
59
{
60
60
  GConfSource source; /* inherit from GConfSource */
61
61
  char *root_dir;
62
 
  guint timeout_id;
63
62
  GConfLock* lock;
64
63
  MarkupTree *tree;
65
64
  guint dir_mode;
875
874
 *  MarkupSource
876
875
 */ 
877
876
 
878
 
/* This timeout periodically unloads
879
 
 * data that hasn't been used in a while.
880
 
 */
881
 
static gboolean
882
 
cleanup_timeout (gpointer data)
883
 
{
884
 
#if 0
885
 
  MarkupSource* ms = (MarkupSource*)data;
886
 
 
887
 
  cache_clean(ms->cache, 60*5 /* 5 minutes */);
888
 
#endif
889
 
  
890
 
  return TRUE;
891
 
}
892
 
 
893
877
static MarkupSource*
894
878
ms_new (const char* root_dir,
895
879
        guint       dir_mode,
903
887
 
904
888
  ms = g_new0(MarkupSource, 1);
905
889
 
906
 
  ms->timeout_id = g_timeout_add (1000*60*5, /* 1 sec * 60 s/min * 5 min */
907
 
                                  cleanup_timeout,
908
 
                                  ms);
909
 
 
910
890
  ms->root_dir = g_strdup (root_dir);
911
891
  
912
892
  ms->lock = lock;
941
921
      error = NULL;
942
922
    }
943
923
  
944
 
  if (!g_source_remove (ms->timeout_id))
945
 
    {
946
 
      /* should not happen, don't translate */
947
 
      gconf_log (GCL_ERR, "timeout not found to remove?");
948
 
    }
949
 
 
950
924
  markup_tree_unref (ms->tree);
951
925
 
952
926
  g_free (ms->root_dir);