gegl r2227 - in trunk: . gegl/buffer
- From: ok svn gnome org
- To: svn-commits-list gnome org
- Subject: gegl r2227 - in trunk: . gegl/buffer
- Date: Thu, 24 Apr 2008 00:45:23 +0100 (BST)
Author: ok
Date: Wed Apr 23 23:45:22 2008
New Revision: 2227
URL: http://svn.gnome.org/viewvc/gegl?rev=2227&view=rev
Log:
Fixes that makes it possible to reopen a buffer with the same path
when a buffer in the same process has been flushed using the path
retrieved from the original buffer.
* gegl/buffer/gegl-buffer.c: (get_property):
* gegl/buffer/gegl-tile-backend-file.c: (flush):
Modified:
trunk/ChangeLog
trunk/gegl/buffer/gegl-buffer.c
trunk/gegl/buffer/gegl-tile-backend-file.c
Modified: trunk/gegl/buffer/gegl-buffer.c
==============================================================================
--- trunk/gegl/buffer/gegl-buffer.c (original)
+++ trunk/gegl/buffer/gegl-buffer.c Wed Apr 23 23:45:22 2008
@@ -51,6 +51,7 @@
#include "gegl-tile-handler.h"
#include "gegl-tile-storage.h"
#include "gegl-tile-backend.h"
+#include "gegl-tile-backend-file.h"
#include "gegl-tile.h"
#include "gegl-tile-handler-cache.h"
#include "gegl-tile-handler-log.h"
@@ -138,7 +139,17 @@
break;
case PROP_PATH:
- g_value_set_string (value, buffer->path);
+ {
+ GeglTileBackend *backend = gegl_buffer_backend (buffer);
+ if (GEGL_IS_TILE_BACKEND_FILE(backend))
+ {
+ if (buffer->path)
+ g_free (buffer->path);
+ buffer->path = NULL;
+ g_object_get (backend, "path", &buffer->path, NULL);
+ }
+ }
+ g_value_set_string (value, buffer->path);
break;
case PROP_PIXELS:
g_value_set_int (value, buffer->extent.width * buffer->extent.height);
Modified: trunk/gegl/buffer/gegl-tile-backend-file.c
==============================================================================
--- trunk/gegl/buffer/gegl-tile-backend-file.c (original)
+++ trunk/gegl/buffer/gegl-tile-backend-file.c Wed Apr 23 23:45:22 2008
@@ -460,27 +460,29 @@
GEGL_NOTE (TILE_BACKEND, "flushing %s", self->path);
+
self->header.next = self->next_pre_alloc; /* this is the offset
we start handing
out headers from*/
-
tiles = g_hash_table_get_keys (self->index);
-/* g_assert(g_seekable_seek (G_SEEKABLE (self->o), self->header.next, G_SEEK_SET, NULL, NULL));*/
- /* save the index */
- {
- GList *iter;
- for (iter = tiles; iter; iter = iter->next)
- {
- GeglBufferItem *item = iter->data;
+ if (tiles == NULL)
+ self->header.next = 0;
+ else
+ {
+ GList *iter;
+ for (iter = tiles; iter; iter = iter->next)
+ {
+ GeglBufferItem *item = iter->data;
+
+ write_block (self, &item->block);
+ }
+ write_block (self, NULL); /* terminate the index */
+ g_list_free (tiles);
+ }
- write_block (self, &item->block);
- }
- }
- write_block (self, NULL); /* terminate the index */
- g_output_stream_flush (self->o, NULL, NULL);
- g_list_free (tiles);
write_header (self);
+ g_output_stream_flush (self->o, NULL, NULL);
GEGL_NOTE (TILE_BACKEND, "flushed %s", self->path);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]