[gnome-documents] epub: Update for API changes



commit 739145b98d918a77112f923f54afbe7e7ed5e50a
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 15 18:24:41 2018 +0100

    epub: Update for API changes
    
    See https://gitlab.gnome.org/GNOME/libgepub/merge_requests/2
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792538

 configure.ac    |    2 +-
 src/epubview.js |   18 +++++++++---------
 src/main.js     |    2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 02f670d..87c55a8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,7 +130,7 @@ AX_CHECK_GIRS_GJS([Tracker], [2.0])
 AX_CHECK_GIRS_GJS([TrackerControl], [2.0])
 AX_CHECK_GIRS_GJS([WebKit2], [4.0])
 AX_CHECK_GIRS_GJS([Zpj], [0.0])
-AX_CHECK_GIRS_GJS([Gepub], [0.5])
+AX_CHECK_GIRS_GJS([Gepub], [0.6])
 
 GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable glib_compile_resources gio-2.0`
 AC_SUBST(GLIB_COMPILE_RESOURCES)
diff --git a/src/epubview.js b/src/epubview.js
index 4abbb8b..88b9580 100644
--- a/src/epubview.js
+++ b/src/epubview.js
@@ -95,7 +95,7 @@ var EPUBView = new Lang.Class({
         this._epubdoc.init(null);
 
         this.view.doc = this._epubdoc;
-        this._epubdoc.connect('notify::page', Lang.bind(this, this._onPageChanged));
+        this._epubdoc.connect('notify::chapter', Lang.bind(this, this._onChapterChanged));
 
         this._metadata = this._loadMetadata();
 
@@ -112,13 +112,13 @@ var EPUBView = new Lang.Class({
 
         let [res, val] = metadata.get_int('page');
         if (res)
-            this._epubdoc.page = val;
+            this._epubdoc.chapter = val;
 
         return metadata;
     },
 
-    _onPageChanged: function() {
-        let pageNumber = this._epubdoc.page;
+    _onChapterChanged: function() {
+        let pageNumber = this._epubdoc.chapter;
         if (this._metadata)
             this._metadata.set_int('page', pageNumber);
     },
@@ -145,15 +145,15 @@ var EPUBView = new Lang.Class({
     },
 
     get hasPages() {
-        return this._epubdoc ? this._epubdoc.get_n_pages() > 0 : false;
+        return this._epubdoc ? this._epubdoc.get_n_chapters() > 0 : false;
     },
 
     get page() {
-        return this._epubdoc ? this._epubdoc.get_page() : 0;
+        return this._epubdoc ? this._epubdoc.get_chapter() : 0;
     },
 
     get numPages() {
-        return this._epubdoc ? this._epubdoc.get_n_pages() : 0;
+        return this._epubdoc ? this._epubdoc.get_n_chapters() : 0;
     },
 
     get canFullscreen() {
@@ -214,7 +214,7 @@ const EPUBViewNavControls = new Lang.Class({
 
         if (this._epubdoc != null) {
             this._level.set_range(1.0, this.preview.numPages);
-            this._epubdoc.connect('notify::page', Lang.bind(this, function() {
+            this._epubdoc.connect('notify::chapter', Lang.bind(this, function() {
                 this._updatePage();
                 this._updateVisibility();
             }));
@@ -245,7 +245,7 @@ const EPUBViewNavControls = new Lang.Class({
         barWidget.pack_start(this._level, true, true, 5);
         this._level.connect('value-changed', Lang.bind(this, function() {
             if (this._epubdoc != null)
-                this._epubdoc.set_page(this._level.get_value() - 1);
+                this._epubdoc.set_chapter(this._level.get_value() - 1);
         }));
 
         return barWidget;
diff --git a/src/main.js b/src/main.js
index 3c32148..2aceb54 100644
--- a/src/main.js
+++ b/src/main.js
@@ -28,7 +28,7 @@ pkg.initSubmodule('src');
 pkg.require({ 'EvinceDocument': '3.0',
               'Gd': '1.0',
               'GdPrivate': '1.0',
-              'Gepub': '0.5',
+              'Gepub': '0.6',
               'Gio': '2.0',
               'GLib': '2.0',
               'Goa': '1.0',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]