diff options
author | Alessio Treglia <alessio@debian.org> | 2013-01-15 00:46:37 +0000 |
---|---|---|
committer | Alessio Treglia <alessio@debian.org> | 2013-01-15 00:46:37 +0000 |
commit | 8f1bef0c8abe53da0001b0d4df1f5439fecd9c3b (patch) | |
tree | 67137e06f48cbe06c0bf16052ea446edf63eb7a0 /src/book.vala | |
parent | d723aded8c1b91731f391754358750e9119d6689 (diff) | |
parent | b99db4e5834bb8668c249bb7ce30af9a4d23527e (diff) |
Merge tag 'upstream/3.6.0'
Upstream version 3.6.0
Diffstat (limited to 'src/book.vala')
-rw-r--r-- | src/book.vala | 23 |
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; - } + } } |