Use local time rather than Greenwich Mean Time
2001-01-25 Bradford Hovinen <hovinen@ximian.com> * config-log.c (get_current_date): Use local time rather than Greenwich Mean Time * location.c (location_store_xml): Implement; copy from location_store (location_store): Free filename after use * archive.c (archive_load): Free prefix only if not global * location.c (location_rollback_all_to): Increment array * util.c (parse_date): Normalize values
This commit is contained in:
parent
c861fe5a55
commit
b3559fa5ac
6 changed files with 58 additions and 3 deletions
|
@ -1,6 +1,15 @@
|
||||||
2001-01-25 Bradford Hovinen <hovinen@ximian.com>
|
2001-01-25 Bradford Hovinen <hovinen@ximian.com>
|
||||||
|
|
||||||
* location.c (location_rollback_all_to): Increment array index
|
* config-log.c (get_current_date): Use local time rather than
|
||||||
|
Greenwich Mean Time
|
||||||
|
|
||||||
|
* location.c (location_store_xml): Implement; copy from
|
||||||
|
location_store
|
||||||
|
(location_store): Free filename after use
|
||||||
|
|
||||||
|
* archive.c (archive_load): Free prefix only if not global
|
||||||
|
|
||||||
|
* location.c (location_rollback_all_to): Increment array
|
||||||
|
|
||||||
* util.c (parse_date): Normalize values
|
* util.c (parse_date): Normalize values
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
* Support multiple backends from CLI
|
* Support multiple backends from CLI
|
||||||
* Add translateable backend description support
|
* Add translateable backend description support
|
||||||
* Some way to store the rollback time for each backend, for GUI purposes
|
* Some way to store the rollback time for each backend, for GUI purposes
|
||||||
|
* Have defaults stored somewhere, to be restored when the user goes
|
||||||
|
back before the first configuration edit
|
||||||
|
|
||||||
Long-term
|
Long-term
|
||||||
* Add clustering support:
|
* Add clustering support:
|
||||||
|
|
|
@ -196,7 +196,7 @@ archive_load (gboolean is_global)
|
||||||
"prefix", prefix,
|
"prefix", prefix,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (is_global)
|
if (!is_global)
|
||||||
g_free (prefix);
|
g_free (prefix);
|
||||||
|
|
||||||
if (do_load (ARCHIVE (object)) == FALSE) {
|
if (do_load (ARCHIVE (object)) == FALSE) {
|
||||||
|
|
|
@ -851,7 +851,7 @@ get_current_date (void)
|
||||||
struct tm *time_1, *ret;
|
struct tm *time_1, *ret;
|
||||||
|
|
||||||
current_time = time (NULL);
|
current_time = time (NULL);
|
||||||
time_1 = gmtime (¤t_time);
|
time_1 = localtime (¤t_time);
|
||||||
ret = g_new (struct tm, 1);
|
ret = g_new (struct tm, 1);
|
||||||
memcpy (ret, time_1, sizeof (struct tm));
|
memcpy (ret, time_1, sizeof (struct tm));
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -434,6 +434,7 @@ location_store (Location *location, gchar *backend_id, FILE *input)
|
||||||
filename = g_strdup_printf ("%s/%08x.xml",
|
filename = g_strdup_printf ("%s/%08x.xml",
|
||||||
location->p->fullpath, id);
|
location->p->fullpath, id);
|
||||||
output = fopen (filename, "w");
|
output = fopen (filename, "w");
|
||||||
|
g_free (filename);
|
||||||
|
|
||||||
if (output == NULL) return;
|
if (output == NULL) return;
|
||||||
|
|
||||||
|
@ -445,6 +446,45 @@ location_store (Location *location, gchar *backend_id, FILE *input)
|
||||||
fclose (output);
|
fclose (output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* location_store_xml:
|
||||||
|
* @location:
|
||||||
|
* @backend_id:
|
||||||
|
* @input:
|
||||||
|
*
|
||||||
|
* Store configuration data from the given XML document object in the location
|
||||||
|
* under the given backend id
|
||||||
|
**/
|
||||||
|
|
||||||
|
void
|
||||||
|
location_store_xml (Location *location, gchar *backend_id, xmlDocPtr xml_doc)
|
||||||
|
{
|
||||||
|
gint id;
|
||||||
|
char *filename;
|
||||||
|
|
||||||
|
g_return_if_fail (location != NULL);
|
||||||
|
g_return_if_fail (IS_LOCATION (location));
|
||||||
|
g_return_if_fail (location->p->config_log != NULL);
|
||||||
|
g_return_if_fail (IS_CONFIG_LOG (location->p->config_log));
|
||||||
|
|
||||||
|
if (!location_contains (location, backend_id)) {
|
||||||
|
if (!location->p->inherits_location)
|
||||||
|
g_warning ("Could not find a location in the " \
|
||||||
|
"tree ancestry that stores this " \
|
||||||
|
"backend.");
|
||||||
|
else
|
||||||
|
location_store_xml (location->p->inherits_location,
|
||||||
|
backend_id, xml_doc);
|
||||||
|
}
|
||||||
|
|
||||||
|
id = config_log_write_entry (location->p->config_log, backend_id);
|
||||||
|
|
||||||
|
filename = g_strdup_printf ("%s/%08x.xml",
|
||||||
|
location->p->fullpath, id);
|
||||||
|
xmlSaveFile (filename, xml_doc);
|
||||||
|
g_free (filename);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* location_rollback_backend_to:
|
* location_rollback_backend_to:
|
||||||
* @location:
|
* @location:
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#define __LOCATION_H
|
#define __LOCATION_H
|
||||||
|
|
||||||
#include <gnome.h>
|
#include <gnome.h>
|
||||||
|
#include <tree.h>
|
||||||
|
|
||||||
#include "config-log.h"
|
#include "config-log.h"
|
||||||
|
|
||||||
|
@ -64,6 +65,9 @@ void location_delete (Location *location);
|
||||||
void location_store (Location *location,
|
void location_store (Location *location,
|
||||||
gchar *backend_id,
|
gchar *backend_id,
|
||||||
FILE *input);
|
FILE *input);
|
||||||
|
void location_store_xml (Location *location,
|
||||||
|
gchar *backend_id,
|
||||||
|
xmlDocPtr xml_doc);
|
||||||
|
|
||||||
void location_rollback_backend_to (Location *location,
|
void location_rollback_backend_to (Location *location,
|
||||||
struct tm *date,
|
struct tm *date,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue