Use read rather than fread

2001-04-24  Bradford Hovinen  <hovinen@ximian.com>

	* location.c (location_store): Use read rather than fread

2001-04-23  Bradford Hovinen  <hovinen@ximian.com>

	* location.c (location_store): Block SIGPIPE
	(location_store): Fix off-by-one bug

	* archive.c (archive_get_current_location_id): Store a full
	snapshot of the system after the default location is created

	* location.c (run_backend_proc): Added parameter do_get to allow
	control of whether pipe is opened to read or write
	(store_snapshot_cb): Implement. Invokes the given backend with
	--get and stores the XML data
	(location_store_full_snapshot): Implement. Stores a complete
	snapshot with all backend data
	(subtract_xml_node): Assume all nodes are the same
	(location_store): Add string termination character
	(location_store): Only store data if any data were actually read

2001-04-22  Bradford Hovinen  <hovinen@ximian.com>

	* config-log.c (config_log_iterate): Use the correct data pointer
	to pass to the callback

	* location.c (location_new): Save the metadata for the newly
	created location right away

	* util.h: Defined DEBUG_MSG macro for debugging messages

	* archive.c (archive_unregister_location): Don't remove the
	location from the tree if the object is marked destroyed

2001-04-21  Bradford Hovinen  <hovinen@ximian.com>

	* archive.c (archive_destroy): Return if the archive was already
	destroyed

	* location.c (location_delete): Unregister the location before
	destroying it

	* config-log.c (config_log_delete): Set deleted flag
	(config_log_destroy): Only dump the log if the log is not marked
	deleted

	* location.c (location_delete): Check return value of rmdir

	* config-log.c (io_buffer_destroy): Call g_io_channel_close to
	close the GIOChannel
	(disconnect_socket): Force the removal of the source id from the
	main loop
	(config_log_destroy): Disconnect the socket after unloading, not
	before

	* location.c (location_delete): Remember to have a NULL at the end
	of arguments to g_strconcat ()

2001-04-22  Bradford Hovinen  <hovinen@ximian.com>

	* location-list.[ch]: Change to inherit GtkObject

	* location-manager-dialog.c (location_manager_dialog_destroy):
	Implement. Close and destroy all aggregated objects.
	(close_cb): Call gtk_object_destroy

2001-04-21  Bradford Hovinen  <hovinen@ximian.com>

	* location-manager-dialog.c (delete_location_cb): Don't let the
	user delete the default location
	(delete_ok_cb): Add some sanity checks to make sure the current
	location is set to something new if we delete it

	* location-list.c (location_list_select): Implement. Selectes the
	given location in the location list

	* location-manager-dialog.c (delete_ok_cb): Use correct semantics
	for callback
This commit is contained in:
Bradford Hovinen 2001-04-25 00:57:59 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent fda9cc2357
commit b38b466dc0
8 changed files with 192 additions and 59 deletions

View file

@ -33,6 +33,7 @@
#include <errno.h>
#include "archive.h"
#include "util.h"
typedef struct _GRealTree GRealTree;
typedef struct _GTreeNode GTreeNode;
@ -233,6 +234,8 @@ archive_destroy (GtkObject *object)
g_return_if_fail (object != NULL);
g_return_if_fail (IS_ARCHIVE (object));
DEBUG_MSG ("Enter");
archive = ARCHIVE (object);
g_tree_traverse (archive->locations,
@ -246,6 +249,8 @@ archive_destroy (GtkObject *object)
g_free (archive->current_location_id);
GTK_OBJECT_CLASS (parent_class)->destroy (GTK_OBJECT (archive));
DEBUG_MSG ("Exit");
}
/**
@ -341,8 +346,9 @@ archive_unregister_location (Archive *archive, Location *location)
g_return_if_fail (location != NULL);
g_return_if_fail (IS_LOCATION (location));
/* FIXME: We might be screwing things up here if we're traversing... */
g_tree_remove (archive->locations, location);
if (GTK_OBJECT_DESTROYED (archive)) return;
g_tree_remove (archive->locations, location_get_id (location));
}
/**
@ -460,6 +466,7 @@ const gchar *
archive_get_current_location_id (Archive *archive)
{
gboolean def;
Location *loc;
g_return_val_if_fail (archive != NULL, NULL);
g_return_val_if_fail (IS_ARCHIVE (archive), NULL);
@ -477,8 +484,13 @@ archive_get_current_location_id (Archive *archive)
/* Create default location if it does not exist */
if (def && archive_get_location
(archive, archive->current_location_id) == NULL)
location_new (archive, archive->current_location_id,
NULL);
{
loc = LOCATION
(location_new (archive,
archive->current_location_id,
NULL));
location_store_full_snapshot (loc);
}
}
return archive->current_location_id;