diff options
author | Iain Holmes <iain@src.gnome.org> | 2000-12-08 08:00:15 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2000-12-08 08:00:15 +0800 |
commit | 4a74b1ff15ca5cbc175c8fb98839960f1af494fb (patch) | |
tree | ed80ade2d481f5a265c0d9a475be689ace09c8df /executive-summary/component/e-summary-prefs.c | |
parent | adf19f49fbdf0e0e69a6ed80fe0cddaf4f3978d1 (diff) | |
download | gsoc2013-evolution-4a74b1ff15ca5cbc175c8fb98839960f1af494fb.tar.gz gsoc2013-evolution-4a74b1ff15ca5cbc175c8fb98839960f1af494fb.tar.zst gsoc2013-evolution-4a74b1ff15ca5cbc175c8fb98839960f1af494fb.zip |
New and improved display,
Bug fixes
memory leaks removed
Preferences
and probably more that I can't remember.
svn path=/trunk/; revision=6858
Diffstat (limited to 'executive-summary/component/e-summary-prefs.c')
-rw-r--r-- | executive-summary/component/e-summary-prefs.c | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/executive-summary/component/e-summary-prefs.c b/executive-summary/component/e-summary-prefs.c new file mode 100644 index 0000000000..ffefdcd583 --- /dev/null +++ b/executive-summary/component/e-summary-prefs.c @@ -0,0 +1,97 @@ +/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ +/* e-summary-prefs.c: Preference handling routines. + * + * Authors: Iain Holmes <iain@helixcode.com> + * + * Copyright (C) 2000 Helix Code, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <gnome.h> +#include "e-summary-prefs.h" +#include "e-summary.h" + +void +e_summary_prefs_free (ESummaryPrefs *prefs) +{ + g_return_if_fail (prefs != NULL); + + g_free (prefs->page); + g_free (prefs); +} + +ESummaryPrefs * +e_summary_prefs_new (void) +{ + ESummaryPrefs *prefs; + + prefs = g_new0 (ESummaryPrefs, 1); + return prefs; +} + +ESummaryPrefs * +e_summary_prefs_copy (ESummaryPrefs *prefs) +{ + ESummaryPrefs *copy; + + g_return_val_if_fail (prefs != NULL, NULL); + + copy = e_summary_prefs_new (); + copy->page = g_strdup (prefs->page); + + return copy; +} + +ESummaryPrefs * +e_summary_prefs_load (const char *path) +{ + ESummaryPrefs *prefs; + char *item; + + g_return_val_if_fail (path != NULL, NULL); + g_return_val_if_fail (*path != '\0', NULL); + + prefs = e_summary_prefs_new (); + + item = g_strdup_printf ("=%s/e-summary=/executive-summary/page", path); + prefs->page = gnome_config_get_string (item); + g_free (item); + + return prefs; +} + +void +e_summary_prefs_save (ESummaryPrefs *prefs, + const char *path) +{ + char *item; + + g_return_if_fail (prefs != NULL); + g_return_if_fail (path != NULL); + g_return_if_fail (*path != '\0'); + + item = g_strdup_printf ("=%s/e-summary=/executive-summary/page", path); + gnome_config_set_string (item, prefs->page); + g_free (item); + + gnome_config_sync (); + gnome_config_drop_all (); +} |