summaryrefslogtreecommitdiff
path: root/src/book.vala
diff options
context:
space:
mode:
authorAlessio Treglia <alessio@debian.org>2013-01-15 00:46:35 +0000
committerAlessio Treglia <alessio@debian.org>2013-01-15 00:46:35 +0000
commitb99db4e5834bb8668c249bb7ce30af9a4d23527e (patch)
tree59506788a14a1d2fdabc08516882b19981260a6d /src/book.vala
parent026e231507aa5dae486255b6450b410f37e3abb0 (diff)
Imported Upstream version 3.6.0upstream/3.6.0
Diffstat (limited to 'src/book.vala')
-rw-r--r--src/book.vala23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/book.vala b/src/book.vala
index 15e79c6..6740fcb 100644
--- a/src/book.vala
+++ b/src/book.vala
@@ -14,7 +14,7 @@ public class Book
private List<Page> pages;
private bool needs_saving;
-
+
public signal void page_added (Page page);
public signal void page_removed (Page page);
public signal void reordered ();
@@ -24,10 +24,25 @@ public class Book
public Book ()
{
+ pages = new List<Page> ();
+ }
+
+ ~Book ()
+ {
+ foreach (var page in pages)
+ {
+ page.pixels_changed.disconnect (page_changed_cb);
+ page.crop_changed.disconnect (page_changed_cb);
+ }
}
public void clear ()
{
+ foreach (var page in pages)
+ {
+ page.pixels_changed.disconnect (page_changed_cb);
+ page.crop_changed.disconnect (page_changed_cb);
+ }
pages = null;
cleared ();
}
@@ -94,7 +109,7 @@ public class Book
string prefix = uri, suffix = "";
var extension_index = basename.last_index_of_char ('.');
if (extension_index >= 0)
- {
+ {
suffix = basename.slice (extension_index, basename.length);
prefix = uri.slice (0, uri.length - suffix.length);
}
@@ -460,7 +475,7 @@ public class Book
writer.write_string ("\n");
writer.write_string ("endstream\n");
writer.write_string ("endobj\n");
-
+
saving (i);
}
@@ -585,5 +600,5 @@ public class PsWriter
}
return Cairo.Status.SUCCESS;
- }
+ }
}