diff --git a/.gitignore b/.gitignore index a3c40aa..8a0378e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/gnome-documents-3.14.3.tar.xz +SOURCES/gnome-documents-3.22.2.tar.xz diff --git a/.gnome-documents.metadata b/.gnome-documents.metadata index 744c231..05815a6 100644 --- a/.gnome-documents.metadata +++ b/.gnome-documents.metadata @@ -1 +1 @@ -4eb9484d2ab647180de048ff260e563f75a995b9 SOURCES/gnome-documents-3.14.3.tar.xz +61295a5226f2e963c46fc4df2f9235643d40b94c SOURCES/gnome-documents-3.22.2.tar.xz diff --git a/SOURCES/gnome-documents-prevent-nested-collections.patch b/SOURCES/gnome-documents-prevent-nested-collections.patch deleted file mode 100644 index 01a3be5..0000000 --- a/SOURCES/gnome-documents-prevent-nested-collections.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 43217734c4b01e894bd1d4efa19d9a07bbb2807c Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Wed, 15 Jun 2016 12:19:49 +0200 -Subject: [PATCH] selections: Prevent nested collections - -https://bugzilla.redhat.com/show_bug.cgi?id=958690 ---- - src/selections.js | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/selections.js b/src/selections.js -index 7c1b47d9983d..cec718b9a793 100644 ---- a/src/selections.js -+++ b/src/selections.js -@@ -841,6 +841,7 @@ const SelectionToolbar = new Lang.Class({ - showShare = false; - - showTrash &= doc.canTrash(); -+ showCollection &= !doc.collection; - showPrint &= !doc.collection; - })); - --- -2.5.5 - diff --git a/SOURCES/gnome-documents-show-a-back-button-while-loading.patch b/SOURCES/gnome-documents-show-a-back-button-while-loading.patch deleted file mode 100644 index d721bd3..0000000 --- a/SOURCES/gnome-documents-show-a-back-button-while-loading.patch +++ /dev/null @@ -1,195 +0,0 @@ -From cbd13f6ce6601387ea59807d899ac378c8fd39b8 Mon Sep 17 00:00:00 2001 -From: Pranav Kant -Date: Mon, 6 Oct 2014 16:51:58 +0200 -Subject: [PATCH 1/3] embed: Switch to the preview as soon as an item starts - loading - -We are essentially in the preview, not the overview, when an item -starts loading. Therefore the UI should relate to the current context. - -https://bugzilla.gnome.org/show_bug.cgi?id=720516 ---- - src/embed.js | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/embed.js b/src/embed.js -index 8d69b78..0bcdcef 100644 ---- a/src/embed.js -+++ b/src/embed.js -@@ -384,6 +384,8 @@ const Embed = new Lang.Class({ - }, - - _onLoadStarted: function() { -+ Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW); -+ - this._clearLoadTimer(); - this._loadShowId = Mainloop.timeout_add(_PDF_LOADER_TIMEOUT, Lang.bind(this, - function() { -@@ -396,8 +398,6 @@ const Embed = new Lang.Class({ - }, - - _onLoadFinished: function(manager, doc, docModel) { -- Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW); -- - docModel.set_sizing_mode(EvView.SizingMode.AUTOMATIC); - docModel.set_page_layout(EvView.PageLayout.AUTOMATIC); - this._toolbar.setModel(docModel); -@@ -410,8 +410,6 @@ const Embed = new Lang.Class({ - }, - - _onLoadError: function(manager, doc, message, exception) { -- Application.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW); -- - this._clearLoadTimer(); - this._spinnerBox.stop(); - this._setError(message, exception.message); -@@ -455,6 +453,8 @@ const Embed = new Lang.Class({ - // pack the toolbar - this._toolbar = new Preview.PreviewToolbar(this._preview); - this._titlebar.add(this._toolbar.widget); -+ -+ this._stack.set_visible_child_name('preview'); - }, - - _prepareForEdit: function() { --- -2.1.0 - - -From 95c0f964979882b9e884f15576a38a2080f9bcd0 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Mon, 6 Oct 2014 18:13:44 +0200 -Subject: [PATCH 2/3] Don't show a glimpse of the older item when going back to - the preview - -Now that we switch to the preview as soon as an item starts loading, we -should take care to clear any older item that might have been previewed -earlier. - -Since EvView does not allow unsetting the model (by passing NULL), we -destroy the old widget and create a new one. We do the same for the -NavControls because of GdNavBar. - -https://bugzilla.gnome.org/show_bug.cgi?id=720516 ---- - src/embed.js | 2 +- - src/preview.js | 18 +++++++++++++++--- - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/src/embed.js b/src/embed.js -index 0bcdcef..d390d0f 100644 ---- a/src/embed.js -+++ b/src/embed.js -@@ -430,7 +430,7 @@ const Embed = new Lang.Class({ - - _prepareForOverview: function() { - if (this._preview) -- this._preview.setModel(null); -+ this._preview.reset(); - if (this._edit) - this._edit.setUri(null); - if (this._toolbar) -diff --git a/src/preview.js b/src/preview.js -index 9431b8b..878925c 100644 ---- a/src/preview.js -+++ b/src/preview.js -@@ -80,9 +80,6 @@ const PreviewView = new Lang.Class({ - this._previewContextMenu = Gtk.Menu.new_from_model(model); - this._previewContextMenu.attach_to_widget(this.widget, null); - -- // create page nav controls -- this._navControls = new PreviewNavControls(this, this._overlay); -- - this.widget.show_all(); - - this._bookmarkPage = Application.application.lookup_action('bookmark-page'); -@@ -339,6 +336,8 @@ const PreviewView = new Lang.Class({ - this._onViewSelectionChanged)); - this.view.connect('external-link', Lang.bind(this, - this._handleExternalLink)); -+ -+ this._navControls = new PreviewNavControls(this, this._overlay); - }, - - _getPreviewContextMenu: function() { -@@ -504,6 +503,13 @@ const PreviewView = new Lang.Class({ - this.emit('search-changed', job.has_results()); - }, - -+ reset: function() { -+ this.setModel(null); -+ this.view.destroy(); -+ this._navControls.destroy(); -+ this._createView(); -+ }, -+ - setModel: function(model) { - if (this._model == model) - return; -@@ -740,6 +746,12 @@ const PreviewNavControls = new Lang.Class({ - hide: function() { - this._visible = false; - this._updateVisibility(); -+ }, -+ -+ destroy: function() { -+ this.bar_widget.destroy(); -+ this.prev_widget.destroy(); -+ this.next_widget.destroy(); - } - }); - --- -2.1.0 - - -From 63aa67d248b7bcddc0025222216ee83ee8fbdbe8 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Tue, 7 Oct 2014 15:04:58 +0200 -Subject: [PATCH 3/3] application, preview: Disable the gear menu while a - document is loading - -https://bugzilla.gnome.org/show_bug.cgi?id=720516 ---- - src/application.js | 3 +-- - src/preview.js | 3 ++- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/application.js b/src/application.js -index e31c643..e6aad0f 100644 ---- a/src/application.js -+++ b/src/application.js -@@ -467,8 +467,7 @@ const Application = new Lang.Class({ - { name: 'gear-menu', - callback: this._onActionToggle, - state: GLib.Variant.new('b', false), -- accel: 'F10', -- window_mode: WindowMode.WindowMode.PREVIEW }, -+ accel: 'F10' }, - { name: 'view-as', - callback: this._onActionViewAs, - create_hook: this._viewAsCreateHook, -diff --git a/src/preview.js b/src/preview.js -index 878925c..f1e49cd 100644 ---- a/src/preview.js -+++ b/src/preview.js -@@ -772,7 +772,7 @@ const PreviewToolbar = new Lang.Class({ - this._searchAction.enabled = false; - - this._gearMenu = Application.application.lookup_action('gear-menu'); -- this._gearMenu.enabled = true; -+ this._gearMenu.enabled = false; - - // back button, on the left of the toolbar - let backButton = this.addBackButton(); -@@ -857,6 +857,7 @@ const PreviewToolbar = new Lang.Class({ - return; - - this._model = model; -+ this._gearMenu.enabled = true; - this._enableSearch(); - this._setToolbarTitle(); - } --- -2.1.0 - diff --git a/SOURCES/gnome-documents-skydrive-printing-and-lok-fixes.patch b/SOURCES/gnome-documents-skydrive-printing-and-lok-fixes.patch new file mode 100644 index 0000000..262eadd --- /dev/null +++ b/SOURCES/gnome-documents-skydrive-printing-and-lok-fixes.patch @@ -0,0 +1,1520 @@ +From 4ba7db7a91de431134c23bd2b43ca4e5e63e2bac Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Wed, 29 Mar 2017 16:04:08 +0200 +Subject: [PATCH 01/16] documents: Simplify calculation of thumbnail paths for + GoogleDocuments + +https://bugzilla.gnome.org/show_bug.cgi?id=780718 +--- + src/documents.js | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index 50cfbdafc7ee..2071882218b2 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -30,6 +30,7 @@ const GdPrivate = imports.gi.GdPrivate; + const Gdk = imports.gi.Gdk; + const GData = imports.gi.GData; + const GLib = imports.gi.GLib; ++const GnomeDesktop = imports.gi.GnomeDesktop; + const Gtk = imports.gi.Gtk; + const Zpj = imports.gi.Zpj; + const _ = imports.gettext.gettext; +@@ -916,12 +917,10 @@ const GoogleDocument = new Lang.Class({ + authorization_domain: authorizationDomain, + download_uri: uri }); + +- let checksum = new GLib.Checksum(GLib.ChecksumType.MD5); +- checksum.update(this.uri, -1); +- let dirPath = GLib.build_filenamev([GLib.get_user_cache_dir(), "thumbnails", "normal"]); ++ let path = GnomeDesktop.desktop_thumbnail_path_for_uri (this.uri, ++ GnomeDesktop.DesktopThumbnailSize.NORMAL); ++ let dirPath = GLib.path_get_dirname(path); + GLib.mkdir_with_parents(dirPath, 448); +- let basename = checksum.get_string() + '.png'; +- let path = GLib.build_filenamev([dirPath, basename]) + + let downloadFile = Gio.File.new_for_path(path); + downloadFile.replace_async +-- +2.9.4 + + +From 7597a3e77b5c0192fc848f5fc7f65bb5b662ed20 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 30 Mar 2017 16:54:15 +0200 +Subject: [PATCH 02/16] documents: Track nfo:fileName for later use + +Now that we can open ODFs and OOXMLs in LOKDocView, we don't need to +convert all remote documents to PDF. For example, we can open office +documents stored from OneDrive without any format conversion. The +nfo:fileName can be used to determine the extension of the cached file. + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + src/documents.js | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index 2071882218b2..6ecc255c9407 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -229,6 +229,7 @@ const DocCommon = new Lang.Class({ + _init: function(cursor) { + this.id = null; + this.uri = null; ++ this.filename = null; + this.name = null; + this.author = null; + this.mtime = null; +@@ -306,12 +307,12 @@ const DocCommon = new Lang.Class({ + this.uri = ''; + + let title = cursor.get_string(Query.QueryColumns.TITLE)[0]; +- let filename = cursor.get_string(Query.QueryColumns.FILENAME)[0]; ++ this.filename = cursor.get_string(Query.QueryColumns.FILENAME)[0]; + + if (title && title != '') + this.name = title; +- else if (filename) +- this.name = GdPrivate.filename_strip_extension(filename); ++ else if (this.filename) ++ this.name = GdPrivate.filename_strip_extension(this.filename); + else + this.name = ''; + +-- +2.9.4 + + +From 291a12b177411b960c91413a51f05493daf98bd1 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 30 Mar 2017 17:25:44 +0200 +Subject: [PATCH 03/16] documents: Add property to denote the URI to be loaded + by the preview + +We want to open ODFs and OOXMLs from OneDrive using LOKDocView, not +EvView. Therefore, the logic to convert a remote document into +something that can be loaded by the different preview widgets can no +longer be hidden inside GdPdfLoader. LOKDocView needs to know the URI +it can load without hitting the network. + +For local and ownCloud this is the same as the actual URI because they +are natively handled by GIO. The property is not defined for Google +because it is still handled entirely by GdPdfLoader. + +This changes the caching for SkydriveDocuments. The old scheme was: + ~/.cache/gnome-documents/gnome-documents-.pdf +The new structure is: + ~/.cache/gnome-documents/skydrive/. + +The new scheme namespaces each document type and uses a hash function +that can be easily replicated by other tools for debugging. This is a +good time to change this because we are about to invalidate existing +caches by not using the ".pdf" extension for all SkydriveDocuments. + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + src/documents.js | 24 +++++++++++++++++++++++- + src/epubview.js | 2 +- + src/lokview.js | 2 +- + 3 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index 6ecc255c9407..c50d50078f2f 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -229,6 +229,7 @@ const DocCommon = new Lang.Class({ + _init: function(cursor) { + this.id = null; + this.uri = null; ++ this.uriToLoad = null; + this.filename = null; + this.name = null; + this.author = null; +@@ -618,7 +619,7 @@ const DocCommon = new Lang.Class({ + return; + } + +- GdPrivate.pdf_loader_load_uri_async(this.uri, passwd, cancellable, Lang.bind(this, ++ GdPrivate.pdf_loader_load_uri_async(this.uriToLoad, passwd, cancellable, Lang.bind(this, + function(source, res) { + try { + let docModel = GdPrivate.pdf_loader_load_uri_finish(res); +@@ -749,6 +750,7 @@ const LocalDocument = new Lang.Class({ + + populateFromCursor: function(cursor) { + this.parent(cursor); ++ this.uriToLoad = this.uri; + + if (!Application.application.gettingStartedLocation) + return; +@@ -1013,6 +1015,11 @@ const OwncloudDocument = new Lang.Class({ + this.defaultAppName = this.defaultApp.get_name(); + }, + ++ populateFromCursor: function(cursor) { ++ this.parent(cursor); ++ this.uriToLoad = this.uri; ++ }, ++ + createThumbnail: function(callback) { + GdPrivate.queue_thumbnail_job_for_file_async(this._file, Lang.bind(this, + function(object, res) { +@@ -1071,6 +1078,21 @@ const SkydriveDocument = new Lang.Class({ + this.sourceName = _("OneDrive"); + }, + ++ populateFromCursor: function(cursor) { ++ this.parent(cursor); ++ ++ let localDir = GLib.build_filenamev([GLib.get_user_cache_dir(), "gnome-documents", "skydrive"]); ++ ++ let identifierHash = GLib.compute_checksum_for_string(GLib.ChecksumType.SHA1, this.identifier, -1); ++ let filenameStripped = GdPrivate.filename_strip_extension(this.filename); ++ let extension = this.filename.substring(filenameStripped.length); ++ let localFilename = identifierHash + extension; ++ ++ let localPath = GLib.build_filenamev([localDir, localFilename]); ++ let localFile = Gio.File.new_for_path(localPath); ++ this.uriToLoad = localFile.get_uri(); ++ }, ++ + _createZpjEntry: function(cancellable, callback) { + let source = Application.sourceManager.getItemById(this.resourceUrn); + +diff --git a/src/epubview.js b/src/epubview.js +index 923b0aa265ab..12f392225d6f 100644 +--- a/src/epubview.js ++++ b/src/epubview.js +@@ -65,7 +65,7 @@ const EPUBView = new Lang.Class({ + onLoadFinished: function(manager, doc) { + this.parent(manager, doc); + +- let f = Gio.File.new_for_uri(doc.uri); ++ let f = Gio.File.new_for_uri(doc.uriToLoad); + this._epubdoc = new Gepub.Doc({ path: f.get_path() }); + this._epubdoc.init(null); + +diff --git a/src/lokview.js b/src/lokview.js +index 092adc5a0471..988db963d5d9 100644 +--- a/src/lokview.js ++++ b/src/lokview.js +@@ -148,7 +148,7 @@ const LOKView = new Lang.Class({ + if (!isAvailable()) + return; + this._doc = doc; +- this._lokview.open_document(doc.uri, '{}', null, Lang.bind(this, this._onDocumentOpened)); ++ this._lokview.open_document(doc.uriToLoad, '{}', null, Lang.bind(this, this._onDocumentOpened)); + this._progressBar.show(); + }, + +-- +2.9.4 + + +From 0ea69b0519a4e374feabc1923c82e1e0c71d5914 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 30 Mar 2017 18:18:16 +0200 +Subject: [PATCH 04/16] documents: Let everybody provide their own download + implementation + +This is meant to reduce our reliance on GdPdfLoader for loading remote +documents. We can open ODFs and OOXMLs in LOKDocView, so we don't need +to convert everything to PDFs. In the future, remote sub-classes will +provider their own implementation to download a document, and this will +help unify the loading across the various sub-classes. + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + src/documents.js | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/src/documents.js b/src/documents.js +index c50d50078f2f..9028e9b5084f 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -360,6 +360,48 @@ const DocCommon = new Lang.Class({ + } + }, + ++ download: function(useCache, cancellable, callback) { ++ let localFile = Gio.File.new_for_uri(this.uriToLoad); ++ let localPath = localFile.get_path(); ++ let localDir = GLib.path_get_dirname(localPath); ++ GLib.mkdir_with_parents(localDir, 448); ++ ++ if (!useCache) { ++ this.downloadImpl(localFile, cancellable, callback); ++ return; ++ } ++ ++ localFile.query_info_async(Gio.FILE_ATTRIBUTE_TIME_MODIFIED, ++ Gio.FileQueryInfoFlags.NONE, ++ GLib.PRIORITY_DEFAULT, ++ cancellable, ++ Lang.bind(this, ++ function(object, res) { ++ let info; ++ ++ try { ++ info = object.query_info_finish(res); ++ } catch (e) { ++ this.downloadImpl(localFile, cancellable, callback); ++ return; ++ } ++ ++ let cacheMtime = info.get_attribute_uint64(Gio.FILE_ATTRIBUTE_TIME_MODIFIED); ++ cacheMtime /= 1000000; ++ ++ if (this.mtime <= cacheMtime) { ++ callback(true, null); ++ return; ++ } ++ ++ this.downloadImpl(localFile, cancellable, callback); ++ })); ++ }, ++ ++ downloadImpl: function(localFile, cancellable, callback) { ++ throw(new Error('DocCommon implementations must override downloadImpl')); ++ }, ++ + load: function() { + log('Error: DocCommon implementations must override load'); + }, +-- +2.9.4 + + +From 630fc1a93bbd3a93ee242231a6a1129aef924127 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 30 Mar 2017 18:23:27 +0200 +Subject: [PATCH 05/16] documents: Implement the downloadImpl vfunc for + SkydriveDocument + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + src/documents.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +diff --git a/src/documents.js b/src/documents.js +index 9028e9b5084f..781019091754 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -1161,6 +1161,62 @@ const SkydriveDocument = new Lang.Class({ + })); + }, + ++ downloadImpl: function(localFile, cancellable, callback) { ++ this._createZpjEntry(cancellable, Lang.bind(this, ++ function(entry, service, error) { ++ if (error) { ++ callback(false, error); ++ return; ++ } ++ ++ service.download_file_to_stream_async(entry, cancellable, Lang.bind(this, ++ function(object, res) { ++ let inputStream; ++ ++ try { ++ inputStream = object.download_file_to_stream_finish(res); ++ } catch (e) { ++ callback(false, e); ++ return; ++ } ++ ++ localFile.replace_async(null, ++ false, ++ Gio.FileCreateFlags.PRIVATE, ++ GLib.PRIORITY_DEFAULT, ++ cancellable, ++ Lang.bind(this, ++ function(object, res) { ++ let outputStream; ++ ++ try { ++ outputStream = object.replace_finish(res); ++ } catch (e) { ++ callback(false, e); ++ return; ++ } ++ ++ outputStream.splice_async(inputStream, ++ Gio.OutputStreamSpliceFlags.CLOSE_SOURCE | ++ Gio.OutputStreamSpliceFlags.CLOSE_TARGET, ++ GLib.PRIORITY_DEFAULT, ++ cancellable, ++ Lang.bind(this, ++ function(object, res) { ++ try { ++ object.splice_finish(res); ++ } catch (e) { ++ callback(false, e); ++ return; ++ } ++ ++ callback(false, null); ++ })); ++ })); ++ })); ++ })); ++ }, ++ + load: function(passwd, cancellable, callback) { + this._createZpjEntry(cancellable, Lang.bind(this, + function(entry, service, exception) { +-- +2.9.4 + + +From c21f27f63ec2cf31c254896ad8343689b9cc9499 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 30 Mar 2017 18:31:18 +0200 +Subject: [PATCH 06/16] documents, pdf-loader: Fix previewing of ODFs and + OOXMLs on OneDrive + +OneDrive documents were being converted to PDFs via GdPdfLoader, but +LOKDocView was being used instead of EvView to render them. LOKDocView +uses the document's URI property, and in this case it is not a valid +URI that it can use. As a result the preview would fail and sometimes +crash the application. + +Solve all that by removing the PDF conversion, and passing the correct +URI to LOKDocView. + +This effectively reverts 0bfb23786dc84d390c4bd6bde5f20987874e1e9b + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + configure.ac | 4 +- + src/documents.js | 50 ++++++------ + src/lib/gd-pdf-loader.c | 205 +----------------------------------------------- + src/lib/gd-pdf-loader.h | 9 --- + 4 files changed, 29 insertions(+), 239 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 78cda4f799d5..8098515028d1 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -57,7 +57,6 @@ GOBJECT_INTROSPECTION_MIN_VERSION=1.31.6 + GDATA_MIN_VERSION=0.13.3 + GOA_MIN_VERSION=3.2.0 + TRACKER_MIN_VERSION=0.17.3 +-ZAPOJIT_MIN_VERSION=0.0.2 + SOUP_MIN_VERSION=2.41.3 + + AC_ARG_ENABLE(documentation, +@@ -85,8 +84,7 @@ PKG_CHECK_MODULES(DOCUMENTS, + tracker-control-1.0 >= $TRACKER_MIN_VERSION + tracker-sparql-1.0 >= $TRACKER_MIN_VERSION + goa-1.0 >= $GOA_MIN_VERSION +- libgdata >= $GDATA_MIN_VERSION +- zapojit-0.0 >= $ZAPOJIT_MIN_VERSION) ++ libgdata >= $GDATA_MIN_VERSION) + + # Although GTK+ 3.10 includes hi-dpi functionality, it does not require a cairo with + # cairo_surface_set_device_scale(), which we also need if we're to support hi-dpi, +diff --git a/src/documents.js b/src/documents.js +index 781019091754..ca48e53db25d 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -1218,34 +1218,36 @@ const SkydriveDocument = new Lang.Class({ + }, + + load: function(passwd, cancellable, callback) { +- this._createZpjEntry(cancellable, Lang.bind(this, +- function(entry, service, exception) { +- if (exception) { +- // try loading from the most recent cache, if any +- GdPrivate.pdf_loader_load_uri_async(this.identifier, passwd, cancellable, Lang.bind(this, +- function(source, res) { +- try { +- let docModel = GdPrivate.pdf_loader_load_uri_finish(res); +- callback(this, docModel, null); +- } catch (e) { +- // report the outmost error only +- callback(this, null, exception); +- } +- })); +- ++ this.download(true, cancellable, Lang.bind(this, ++ function(fromCache, error) { ++ if (error) { ++ callback(this, null, error); + return; + } + +- GdPrivate.pdf_loader_load_zpj_entry_async +- (entry, service, cancellable, Lang.bind(this, +- function(source, res) { +- try { +- let docModel = GdPrivate.pdf_loader_load_zpj_entry_finish(res); +- callback(this, docModel, null); +- } catch (e) { +- callback(this, null, e); ++ this.loadLocal(passwd, cancellable, Lang.bind(this, ++ function(doc, docModel, error) { ++ if (error) { ++ if (fromCache && ++ !error.matches(EvDocument.DocumentError, EvDocument.DocumentError.ENCRYPTED)) { ++ this.download(false, cancellable, Lang.bind(this, ++ function(fromCache, error) { ++ if (error) { ++ callback(this, null, error); ++ return; ++ } ++ ++ this.loadLocal(passwd, cancellable, callback); ++ })); ++ } else { ++ callback(this, null, error); + } +- })); ++ ++ return; ++ } ++ ++ callback(this, docModel, null); ++ })); + })); + }, + +diff --git a/src/lib/gd-pdf-loader.c b/src/lib/gd-pdf-loader.c +index 7a8890e75891..202f6cc0a65f 100644 +--- a/src/lib/gd-pdf-loader.c ++++ b/src/lib/gd-pdf-loader.c +@@ -51,9 +51,6 @@ typedef struct { + GDataService *gdata_service; + gchar *resource_id; + +- ZpjSkydriveEntry *zpj_entry; +- ZpjSkydrive *zpj_service; +- + guint64 pdf_cache_mtime; + guint64 original_file_mtime; + +@@ -64,7 +61,6 @@ typedef struct { + static void pdf_load_job_from_openoffice (PdfLoadJob *job); + static void pdf_load_job_gdata_refresh_cache (PdfLoadJob *job); + static void pdf_load_job_openoffice_refresh_cache (PdfLoadJob *job); +-static void pdf_load_job_zpj_refresh_cache (PdfLoadJob *job); + + /* --------------------------- utils -------------------------------- */ + +@@ -134,8 +130,6 @@ pdf_load_job_free (PdfLoadJob *job) + g_clear_object (&job->download_file); + g_clear_object (&job->gdata_service); + g_clear_object (&job->gdata_entry); +- g_clear_object (&job->zpj_service); +- g_clear_object (&job->zpj_entry); + + g_free (job->uri); + g_free (job->passwd); +@@ -160,7 +154,6 @@ static PdfLoadJob * + pdf_load_job_new (GSimpleAsyncResult *result, + const gchar *uri, + GDataEntry *gdata_entry, +- ZpjSkydriveEntry *zpj_entry, + const gchar *passwd, + GCancellable *cancellable) + { +@@ -178,8 +171,6 @@ pdf_load_job_new (GSimpleAsyncResult *result, + retval->passwd = g_strdup (passwd); + if (gdata_entry != NULL) + retval->gdata_entry = g_object_ref (gdata_entry); +- if (zpj_entry != NULL) +- retval->zpj_entry = g_object_ref (zpj_entry); + if (cancellable != NULL) + retval->cancellable = g_object_ref (cancellable); + +@@ -216,8 +207,6 @@ pdf_load_job_force_refresh_cache (PdfLoadJob *job) + + if (job->gdata_entry != NULL) + pdf_load_job_gdata_refresh_cache (job); +- if (job->zpj_entry != NULL) +- pdf_load_job_zpj_refresh_cache (job); + else + pdf_load_job_openoffice_refresh_cache (job); + } +@@ -429,61 +418,6 @@ pdf_load_job_gdata_refresh_cache (PdfLoadJob *job) + } + + static void +-zpj_download_stream_ready (GObject *source, +- GAsyncResult *res, +- gpointer user_data) +-{ +- GError *error = NULL; +- PdfLoadJob *job = (PdfLoadJob *) user_data; +- const gchar *name; +- const gchar *extension; +- +- job->stream = zpj_skydrive_download_file_to_stream_finish (ZPJ_SKYDRIVE (source), res, &error); +- if (error != NULL) { +- pdf_load_job_complete_error (job, error); +- return; +- } +- +- name = zpj_skydrive_entry_get_name (job->zpj_entry); +- extension = gd_filename_get_extension_offset (name); +- +- /* If it is not a PDF, we need to convert it afterwards. +- * http://msdn.microsoft.com/en-us/library/live/hh826545#fileformats +- */ +- if (g_strcmp0 (extension, ".pdf") != 0) +- { +- GFileIOStream *iostream; +- +- job->download_file = g_file_new_tmp (NULL, &iostream, &error); +- if (error != NULL) { +- pdf_load_job_complete_error (job, error); +- return; +- } +- +- /* We don't need the iostream. */ +- g_io_stream_close (G_IO_STREAM (iostream), NULL, NULL); +- } +- else +- job->download_file = g_file_new_for_path (job->pdf_path); +- +- g_file_replace_async (job->download_file, NULL, FALSE, +- G_FILE_CREATE_PRIVATE, +- G_PRIORITY_DEFAULT, +- job->cancellable, file_replace_ready_cb, +- job); +-} +- +-static void +-pdf_load_job_zpj_refresh_cache (PdfLoadJob *job) +-{ +- zpj_skydrive_download_file_to_stream_async (job->zpj_service, +- ZPJ_SKYDRIVE_FILE (job->zpj_entry), +- job->cancellable, +- zpj_download_stream_ready, +- job); +-} +- +-static void + gdata_cache_query_info_ready_cb (GObject *source, + GAsyncResult *res, + gpointer user_data) +@@ -518,40 +452,6 @@ gdata_cache_query_info_ready_cb (GObject *source, + } + + static void +-zpj_cache_query_info_ready_cb (GObject *source, +- GAsyncResult *res, +- gpointer user_data) +-{ +- PdfLoadJob *job = user_data; +- GError *error = NULL; +- GFileInfo *info; +- guint64 cache_mtime; +- +- info = g_file_query_info_finish (G_FILE (source), res, &error); +- +- if (error != NULL) { +- /* create/invalidate cache */ +- pdf_load_job_zpj_refresh_cache (job); +- g_error_free (error); +- +- return; +- } +- +- job->pdf_cache_mtime = cache_mtime = +- g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED); +- g_object_unref (info); +- +- if (job->original_file_mtime != cache_mtime) { +- pdf_load_job_zpj_refresh_cache (job); +- } else { +- job->from_old_cache = TRUE; +- +- /* load the cached file */ +- pdf_load_job_from_pdf (job); +- } +-} +- +-static void + pdf_load_job_from_google_documents (PdfLoadJob *job) + { + gchar *tmp_name; +@@ -583,39 +483,6 @@ pdf_load_job_from_google_documents (PdfLoadJob *job) + } + + static void +-pdf_load_job_from_skydrive (PdfLoadJob *job) +-{ +- gchar *tmp_name; +- gchar *tmp_path, *pdf_path; +- GDateTime *updated_time; +- GFile *pdf_file; +- +- updated_time = zpj_skydrive_entry_get_updated_time (job->zpj_entry); +- job->original_file_mtime = (guint64) g_date_time_to_unix (updated_time); +- +- tmp_name = g_strdup_printf ("gnome-documents-%u.pdf", +- g_str_hash (zpj_skydrive_entry_get_id (job->zpj_entry))); +- tmp_path = g_build_filename (g_get_user_cache_dir (), "gnome-documents", NULL); +- job->pdf_path = pdf_path = +- g_build_filename (tmp_path, tmp_name, NULL); +- g_mkdir_with_parents (tmp_path, 0700); +- +- pdf_file = g_file_new_for_path (pdf_path); +- +- g_file_query_info_async (pdf_file, +- G_FILE_ATTRIBUTE_TIME_MODIFIED, +- G_FILE_QUERY_INFO_NONE, +- G_PRIORITY_DEFAULT, +- job->cancellable, +- zpj_cache_query_info_ready_cb, +- job); +- +- g_free (tmp_name); +- g_free (tmp_path); +- g_object_unref (pdf_file); +-} +- +-static void + pdf_load_job_from_gdata_cache (PdfLoadJob *job) + { + gchar *tmp_name; +@@ -633,23 +500,6 @@ pdf_load_job_from_gdata_cache (PdfLoadJob *job) + } + + static void +-pdf_load_job_from_zpj_cache (PdfLoadJob *job) +-{ +- gchar *tmp_name; +- gchar *tmp_path; +- +- tmp_name = g_strdup_printf ("gnome-documents-%u.pdf", +- g_str_hash (job->resource_id)); +- tmp_path = g_build_filename (g_get_user_cache_dir (), "gnome-documents", NULL); +- job->pdf_path = g_build_filename (tmp_path, tmp_name, NULL); +- +- pdf_load_job_from_pdf (job); +- +- g_free (tmp_path); +- g_free (tmp_name); +-} +- +-static void + unoconv_cancelled_cb (GCancellable *cancellable, + gpointer user_data) + { +@@ -1134,7 +984,6 @@ pdf_load_job_from_uri (PdfLoadJob *job) + { + GFile *file; + const gchar *gdata_prefix = "google:drive:"; +- const gchar *zpj_prefix = "windows-live:skydrive:"; + + if (g_str_has_prefix (job->uri, gdata_prefix)) { + job->resource_id = g_strdup (job->uri + strlen (gdata_prefix)); +@@ -1142,12 +991,6 @@ pdf_load_job_from_uri (PdfLoadJob *job) + return; + } + +- if (g_str_has_prefix (job->uri, zpj_prefix)) { +- job->resource_id = g_strdup (job->uri + strlen (zpj_prefix)); +- pdf_load_job_from_zpj_cache (job); +- return; +- } +- + file = g_file_new_for_uri (job->uri); + if (!g_file_is_native (file)) + pdf_load_job_from_remote_file (job); +@@ -1162,8 +1005,6 @@ pdf_load_job_start (PdfLoadJob *job) + { + if (job->gdata_entry != NULL) + pdf_load_job_from_google_documents (job); +- else if (job->zpj_entry != NULL) +- pdf_load_job_from_skydrive (job); + else + pdf_load_job_from_uri (job); + } +@@ -1189,7 +1030,7 @@ gd_pdf_loader_load_uri_async (const gchar *uri, + result = g_simple_async_result_new (NULL, callback, user_data, + gd_pdf_loader_load_uri_async); + +- job = pdf_load_job_new (result, uri, NULL, NULL, passwd, cancellable); ++ job = pdf_load_job_new (result, uri, NULL, passwd, cancellable); + + pdf_load_job_start (job); + +@@ -1230,7 +1071,7 @@ gd_pdf_loader_load_gdata_entry_async (GDataEntry *entry, + result = g_simple_async_result_new (NULL, callback, user_data, + gd_pdf_loader_load_gdata_entry_async); + +- job = pdf_load_job_new (result, NULL, entry, NULL, NULL, cancellable); ++ job = pdf_load_job_new (result, NULL, entry, NULL, cancellable); + job->gdata_service = g_object_ref (service); + + pdf_load_job_start (job); +@@ -1257,45 +1098,3 @@ gd_pdf_loader_load_gdata_entry_finish (GAsyncResult *res, + retval = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); + return retval; + } +- +- +-void +-gd_pdf_loader_load_zpj_entry_async (ZpjSkydriveEntry *entry, +- ZpjSkydrive *service, +- GCancellable *cancellable, +- GAsyncReadyCallback callback, +- gpointer user_data) +-{ +- PdfLoadJob *job; +- GSimpleAsyncResult *result; +- +- result = g_simple_async_result_new (NULL, callback, user_data, +- gd_pdf_loader_load_zpj_entry_async); +- +- job = pdf_load_job_new (result, NULL, NULL, entry, NULL, cancellable); +- job->zpj_service = g_object_ref (service); +- +- pdf_load_job_start (job); +- +- g_object_unref (result); +-} +- +-/** +- * gd_pdf_loader_load_zpj_entry_finish: +- * @res: +- * @error: (allow-none) (out): +- * +- * Returns: (transfer full): +- */ +-EvDocumentModel * +-gd_pdf_loader_load_zpj_entry_finish (GAsyncResult *res, +- GError **error) +-{ +- EvDocumentModel *retval; +- +- if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) +- return NULL; +- +- retval = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (res)); +- return retval; +-} +diff --git a/src/lib/gd-pdf-loader.h b/src/lib/gd-pdf-loader.h +index 9e5ffb737eee..70ded295dad3 100644 +--- a/src/lib/gd-pdf-loader.h ++++ b/src/lib/gd-pdf-loader.h +@@ -28,7 +28,6 @@ + + #define GOA_API_IS_SUBJECT_TO_CHANGE + #include +-#include + + G_BEGIN_DECLS + +@@ -48,14 +47,6 @@ void gd_pdf_loader_load_gdata_entry_async (GDataEntry *entry, + EvDocumentModel *gd_pdf_loader_load_gdata_entry_finish (GAsyncResult *res, + GError **error); + +-void gd_pdf_loader_load_zpj_entry_async (ZpjSkydriveEntry *entry, +- ZpjSkydrive *service, +- GCancellable *cancellable, +- GAsyncReadyCallback callback, +- gpointer user_data); +-EvDocumentModel *gd_pdf_loader_load_zpj_entry_finish (GAsyncResult *res, +- GError **error); +- + G_END_DECLS + + #endif /* __GD_PDF_LOADER_H__ */ +-- +2.9.4 + + +From b80863a8d5666c9bd246a09bf770a8ea58367637 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 20 Apr 2017 11:51:47 +0200 +Subject: [PATCH 07/16] documents: Fix the retrieval of the cache's + modification time + +Gio.FILE_ATTRIBUTE_TIME_MODIFIED returns a value in seconds, not +microseconds. + +Fallout from 4133adf06a0ff473e6234f8ab3eb88c47589e627 + +https://bugzilla.gnome.org/show_bug.cgi?id=774937 +--- + src/documents.js | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index ca48e53db25d..4db7d07029b4 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -387,8 +387,6 @@ const DocCommon = new Lang.Class({ + } + + let cacheMtime = info.get_attribute_uint64(Gio.FILE_ATTRIBUTE_TIME_MODIFIED); +- cacheMtime /= 1000000; +- + if (this.mtime <= cacheMtime) { + callback(true, null); + return; +-- +2.9.4 + + +From dd1343e7869882d632d75307b396de0c3fde4447 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Tue, 18 Apr 2017 19:01:26 +0200 +Subject: [PATCH 08/16] Optionally load the document when determining if it can + be printed + +https://bugzilla.gnome.org/show_bug.cgi?id=781533 +--- + src/documents.js | 99 ++++++++++++++++++++++++++++++++++++------------------- + src/evinceview.js | 8 ++++- + 2 files changed, 72 insertions(+), 35 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index 4db7d07029b4..fb0eee962548 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -36,6 +36,7 @@ const Zpj = imports.gi.Zpj; + const _ = imports.gettext.gettext; + + const Lang = imports.lang; ++const Mainloop = imports.mainloop; + const Signals = imports.signals; + + const Application = imports.application; +@@ -416,11 +417,37 @@ const DocCommon = new Lang.Class({ + log('Error: DocCommon implementations must override canTrash'); + }, + +- canPrint: function(docModel) { +- if (!docModel) +- return false; ++ canPrint: function(docModel, cancellable, callback) { ++ if (docModel) { ++ Mainloop.idle_add(Lang.bind(this, ++ function() { ++ this._canPrint(docModel, callback); ++ return GLib.SOURCE_REMOVE; ++ })); ++ ++ return; ++ } ++ ++ this.load(null, cancellable, Lang.bind(this, ++ function(doc, docModel, error) { ++ if (error) { ++ callback(this, false); ++ return; ++ } ++ ++ this._canPrint(docModel, callback); ++ })); ++ }, ++ ++ _canPrint: function(docModel, callback) { ++ if (!docModel) { ++ callback(this, false); ++ return; ++ } + +- return EvView.PrintOperation.exists_for_document(docModel.get_document()); ++ let evDoc = docModel.get_document(); ++ let supported = EvView.PrintOperation.exists_for_document(evDoc); ++ callback(this, supported); + }, + + trash: function() { +@@ -694,41 +721,45 @@ const DocCommon = new Lang.Class({ + return; + } + +- if (!this.canPrint(docModel)) +- return; ++ this.canPrint(docModel, null, Lang.bind(this, ++ function(doc, supported) { ++ if (!supported) ++ return; + +- let printOp = EvView.PrintOperation.new(docModel.get_document()); ++ let printOp = EvView.PrintOperation.new(docModel.get_document()); + +- printOp.connect('begin-print', Lang.bind(this, +- function() { +- Application.selectionController.setSelectionMode(false); +- })); + +- printOp.connect('done', Lang.bind(this, +- function(op, res) { +- if (res == Gtk.PrintOperationResult.ERROR) { +- try { +- printOp.get_error(); +- } catch (e) { +- let errorDialog = new Gtk.MessageDialog ({ transient_for: toplevel, +- modal: true, +- destroy_with_parent: true, +- buttons: Gtk.ButtonsType.OK, +- message_type: Gtk.MessageType.ERROR, +- text: _("Failed to print document"), +- secondary_text: e.message }); +- errorDialog.connect ('response', Lang.bind(this, +- function() { +- errorDialog.destroy(); +- })); +- errorDialog.show(); +- } +- } +- })); ++ printOp.connect('begin-print', Lang.bind(this, ++ function() { ++ Application.selectionController.setSelectionMode(false); ++ })); + +- let printNotification = new Notifications.PrintNotification(printOp, doc); ++ printOp.connect('done', Lang.bind(this, ++ function(op, res) { ++ if (res == Gtk.PrintOperationResult.ERROR) { ++ try { ++ printOp.get_error(); ++ } catch (e) { ++ let errorDialog = new Gtk.MessageDialog ({ transient_for: toplevel, ++ modal: true, ++ destroy_with_parent: true, ++ buttons: Gtk.ButtonsType.OK, ++ message_type: Gtk.MessageType.ERROR, ++ text: _("Failed to print document"), ++ secondary_text: e.message }); ++ errorDialog.connect ('response', Lang.bind(this, ++ function() { ++ errorDialog.destroy(); ++ })); ++ errorDialog.show(); ++ } ++ } ++ })); ++ ++ let printNotification = new Notifications.PrintNotification(printOp, doc); + +- printOp.run(toplevel); ++ printOp.run(toplevel); ++ })); + })); + }, + +diff --git a/src/evinceview.js b/src/evinceview.js +index d4ea883e76b4..3e0070bb785c 100644 +--- a/src/evinceview.js ++++ b/src/evinceview.js +@@ -264,7 +264,13 @@ const EvinceView = new Lang.Class({ + + this.getAction('copy').enabled = false; + this.getAction('edit-current').enabled = doc.canEdit(); +- this.getAction('print-current').enabled = doc.canPrint(docModel); ++ ++ this.getAction('print-current').enabled = false; ++ doc.canPrint(docModel, null, Lang.bind(this, ++ function(doc, supported) { ++ this.getAction('print-current').enabled = supported; ++ })); ++ + let presentCurrent = this.getAction('present-current'); + if (presentCurrent) + presentCurrent.enabled = true; +-- +2.9.4 + + +From c37a9a62610ba301f09d2e53a4004dcbf12dadec Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 20 Apr 2017 14:40:40 +0200 +Subject: [PATCH 09/16] documents: Check whether it is a collection in canPrint + +https://bugzilla.gnome.org/show_bug.cgi?id=781533 +--- + src/documents.js | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/documents.js b/src/documents.js +index fb0eee962548..3bed18c36a49 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -418,6 +418,16 @@ const DocCommon = new Lang.Class({ + }, + + canPrint: function(docModel, cancellable, callback) { ++ if (this.collection) { ++ Mainloop.idle_add(Lang.bind(this, ++ function() { ++ callback(this, false); ++ return GLib.SOURCE_REMOVE; ++ })); ++ ++ return; ++ } ++ + if (docModel) { + Mainloop.idle_add(Lang.bind(this, + function() { +-- +2.9.4 + + +From 7d63e3fc760aef6ec56868a16e930af8977f0973 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 20 Apr 2017 14:59:12 +0200 +Subject: [PATCH 10/16] selections: Enable printing only for documents handled + by EvView + +Now that we don't convert everything to PDFs, we might not be able to +print everything that's not a collection. eg., we can't print EPUBs, +ODFs and OOXMLs. Therefore it is not enough to only check for +collections. + +Instead, let's use canPrint which encapsulates all the conditions that +need to be met for printing. + +https://bugzilla.gnome.org/show_bug.cgi?id=781533 +--- + src/selections.js | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/src/selections.js b/src/selections.js +index b864c8f8a634..ecfd3ec694c7 100644 +--- a/src/selections.js ++++ b/src/selections.js +@@ -946,7 +946,7 @@ const SelectionToolbar = new Lang.Class({ + let hasSelection = (selection.length > 0); + + let showTrash = hasSelection; +- let showPrint = hasSelection; ++ let showPrint = false; + let showProperties = hasSelection; + let showOpen = hasSelection; + let showShare = hasSelection; +@@ -967,16 +967,21 @@ const SelectionToolbar = new Lang.Class({ + showShare = false; + + showTrash &= doc.canTrash(); +- showPrint &= !doc.collection; + })); + + showOpen = (apps.length > 0); + +- if (selection.length > 1) { +- showPrint = false; +- showProperties = false; ++ if (selection.length == 1) { ++ let doc = Application.documentManager.getItemById(selection[0]); ++ doc.canPrint(null, null, Lang.bind(this, ++ function(doc, supported) { ++ this._toolbarPrint.set_sensitive(supported); ++ })); + } + ++ if (selection.length > 1) ++ showProperties = false; ++ + let openLabel = null; + if (apps.length == 1) { + // Translators: this is the Open action in a context menu +-- +2.9.4 + + +From aa507bc55aef99815308fe7865f016d40ed6f76d Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 27 Mar 2017 16:08:57 +0200 +Subject: [PATCH 11/16] documents: Thumbnail SkydriveDocuments once they are + loaded +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Historically, unlike GoogleDocuments, we were unable to fetch +server-side thumbnails for SkydriveDocuments due to limitations of +OneDrive's REST API. Newer versions of the REST API do support it [1], +but it is not implemented in libzapojit. + +Some ways to work around these limitations: + - Create the thumbnail from the EvDocument when it is loaded for + previewing + - Use a cached copy of the document as source for the thumbnail + +Even if we can fetch thumbnails from the server in future, these would +still be nice optimizations to have — reduces network consumption and +offers a cheap way to jump ahead in the thumbnailing queue. + +[1] https://dev.onedrive.com/items/thumbnails.htm +--- + src/documents.js | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 109 insertions(+), 2 deletions(-) + +diff --git a/src/documents.js b/src/documents.js +index 3bed18c36a49..27518b2251d1 100644 +--- a/src/documents.js ++++ b/src/documents.js +@@ -1150,7 +1150,7 @@ const SkydriveDocument = new Lang.Class({ + Extends: DocCommon, + + _init: function(cursor) { +- this._failedThumbnailing = true; ++ this._failedThumbnailing = false; + + this.parent(cursor); + +@@ -1174,6 +1174,54 @@ const SkydriveDocument = new Lang.Class({ + this.uriToLoad = localFile.get_uri(); + }, + ++ _createThumbnailFromEvDocument: function(evDoc, cancellable, callback) { ++ let thumbnailPath = GnomeDesktop.desktop_thumbnail_path_for_uri (this.uri, ++ GnomeDesktop.DesktopThumbnailSize.LARGE); ++ let thumbnailFile = Gio.File.new_for_path(thumbnailPath); ++ ++ let thumbnailDir = GLib.path_get_dirname(thumbnailPath); ++ GLib.mkdir_with_parents(thumbnailDir, 448); ++ ++ thumbnailFile.replace_async(null, ++ false, ++ Gio.FileCreateFlags.PRIVATE, ++ GLib.PRIORITY_DEFAULT, ++ cancellable, ++ Lang.bind(this, ++ function(source, res) { ++ let outputStream; ++ ++ try { ++ outputStream = thumbnailFile.replace_finish(res); ++ } catch (e) { ++ callback(e); ++ return; ++ } ++ ++ let [width, height] = evDoc.get_page_size(0); ++ let maxDimension = Math.max(width, height); ++ let scale = Application.application.getScaleFactor(); ++ let size = 128 * scale; ++ let zoom = size / maxDimension; ++ ++ let page = evDoc.get_page(0); ++ ++ let rc = EvDocument.RenderContext.new(page, 0, zoom); ++ let pixbuf = evDoc.get_thumbnail(rc); ++ pixbuf.save_to_streamv_async(outputStream, "png", [], [], cancellable, Lang.bind(this, ++ function(source, res) { ++ try { ++ GdkPixbuf.Pixbuf.save_to_stream_finish(res); ++ } catch (e) { ++ callback(e); ++ return; ++ } ++ ++ callback(null); ++ })); ++ })); ++ }, ++ + _createZpjEntry: function(cancellable, callback) { + let source = Application.sourceManager.getItemById(this.resourceUrn); + +@@ -1276,7 +1324,16 @@ const SkydriveDocument = new Lang.Class({ + return; + } + +- this.loadLocal(passwd, cancellable, callback); ++ this.loadLocal(passwd, cancellable, Lang.bind(this, ++ function(doc, docModel, error) { ++ if (error) { ++ callback(this, null, error); ++ return; ++ } ++ ++ callback(this, docModel, null); ++ this._postLoad(docModel); ++ })); + })); + } else { + callback(this, null, error); +@@ -1286,6 +1343,56 @@ const SkydriveDocument = new Lang.Class({ + } + + callback(this, docModel, null); ++ this._postLoad(docModel); ++ })); ++ })); ++ }, ++ ++ _postLoad: function(docModel) { ++ if (this._thumbPath) ++ return; ++ ++ if (!docModel) ++ return; ++ ++ this._createThumbnailFromEvDocument(docModel.document, null, Lang.bind(this, ++ function(error) { ++ if (error) { ++ logError(error, 'Unable to create thumbnail from EvDocument'); ++ return; ++ } ++ ++ this._failedThumbnailing = false; ++ this.refreshIcon(); ++ })); ++ }, ++ ++ createThumbnail: function(callback) { ++ // try loading from the most recent cache, if any ++ this.loadLocal(null, null, Lang.bind(this, ++ function(doc, docModel, error) { ++ if (error) { ++ if (!error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND) && ++ !error.matches(EvDocument.DocumentError, EvDocument.DocumentError.ENCRYPTED)) { ++ logError(error, 'Unable to load document from the cache'); ++ callback(false); ++ return; ++ } ++ } ++ ++ if (!docModel) { ++ callback(false); ++ return; ++ } ++ ++ this._createThumbnailFromEvDocument(docModel.document, null, Lang.bind(this, ++ function(error) { ++ if (error) { ++ logError(error, 'Unable to create thumbnail from EvDocument'); ++ return; ++ } ++ ++ callback(true); + })); + })); + }, +-- +2.9.4 + + +From 3bd516524432f9decb0a15ab209a9957b7ae7488 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 8 May 2017 16:44:32 +0100 +Subject: [PATCH 12/16] lokview: Fix crash on repeated open of presentations + +Ensure prompt destruction of the LOKDocView widget when the view is +destroyed. This gives LOK a chance to shutdown at the right time. + +https://bugzilla.gnome.org/show_bug.cgi?id=782508 +--- + src/lokview.js | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/lokview.js b/src/lokview.js +index 988db963d5d9..238832ed4502 100644 +--- a/src/lokview.js ++++ b/src/lokview.js +@@ -137,11 +137,19 @@ const LOKView = new Lang.Class({ + this._lokview.connect('text-selection', Lang.bind(this, this._onTextSelection)); + this._lokview.connect('notify::can-zoom-in', Lang.bind(this, this._onCanZoomInChanged)); + this._lokview.connect('notify::can-zoom-out', Lang.bind(this, this._onCanZoomOutChanged)); ++ this.connect('destroy', Lang.bind(this, this._destroyView)); + } + + return sw; + }, + ++ _destroyView: function() { ++ if (this._lokview) { ++ this._lokview.destroy(); ++ this._lokview = null; ++ } ++ }, ++ + onLoadFinished: function(manager, doc) { + this.parent(manager, doc); + +@@ -237,10 +245,10 @@ const LOKView = new Lang.Class({ + }, + + get page() { +- return this._lokview.get_part(); ++ return this._lokview ? this._lokview.get_part() : 0; + }, + + get numPages() { +- return this._lokview.get_parts(); ++ return this._lokview ? this._lokview.get_parts() : 0; + } + }); +-- +2.9.4 + + +From 238a4d4c95b78eff9d1a764f184936ddc58db73d Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 8 Jun 2017 16:10:57 +0200 +Subject: [PATCH 13/16] application: Avoid CRITICALs if a primary instance is + already present + +The dbus_unregister method can be invoked more than once. Trying to +unexport an already unexported GDBusInterfaceSkeleton led to: + GLib-GIO-CRITICAL **: + g_dbus_interface_skeleton_unexport_from_connection: assertion + 'interface_->priv->connections != NULL' failed + +https://bugzilla.gnome.org/show_bug.cgi?id=783548 +--- + src/application.js | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/application.js b/src/application.js +index a82395d6afd2..40a5dd0e5114 100644 +--- a/src/application.js ++++ b/src/application.js +@@ -521,7 +521,10 @@ const Application = new Lang.Class({ + }, + + vfunc_dbus_unregister: function(connection, path) { +- this._searchProvider.unexport(connection); ++ if (this._searchProvider != null) { ++ this._searchProvider.unexport(connection); ++ this._searchProvider = null; ++ } + + this.parent(connection, path); + }, +-- +2.9.4 + + +From ca10b8d02486630db2f3de746ee4b885490cbaab Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 8 Jun 2017 16:12:15 +0200 +Subject: [PATCH 14/16] application: Instantiate ShellSearchProvider only when + registering + +Now that the --version flag was implemented using the +handle_local_options virtual method, it is possible that the +Application may exit without ever touching D-Bus. So it is a tad +wasteful to instantiate the ShellSearchProvider when it is never going +to be used. Since we are unreffing it in dbus_register, we might as +well create it in dbus_register. + +https://bugzilla.gnome.org/show_bug.cgi?id=783548 +--- + src/application.js | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/application.js b/src/application.js +index 40a5dd0e5114..2630e1971826 100644 +--- a/src/application.js ++++ b/src/application.js +@@ -100,6 +100,7 @@ const Application = new Lang.Class({ + this.minersRunning = []; + this._activationTimestamp = Gdk.CURRENT_TIME; + this._extractPriority = null; ++ this._searchProvider = null; + + this.isBooks = isBooks; + +@@ -120,10 +121,6 @@ const Application = new Lang.Class({ + + this.add_main_option('version', 'v'.charCodeAt(0), GLib.OptionFlags.NONE, GLib.OptionArg.NONE, + _("Show the version of the program"), null); +- +- this._searchProvider = new ShellSearchProvider.ShellSearchProvider(); +- this._searchProvider.connect('activate-result', Lang.bind(this, this._onActivateResult)); +- this._searchProvider.connect('launch-search', Lang.bind(this, this._onLaunchSearch)); + }, + + _initGettingStarted: function() { +@@ -516,6 +513,10 @@ const Application = new Lang.Class({ + vfunc_dbus_register: function(connection, path) { + this.parent(connection, path); + ++ this._searchProvider = new ShellSearchProvider.ShellSearchProvider(); ++ this._searchProvider.connect('activate-result', Lang.bind(this, this._onActivateResult)); ++ this._searchProvider.connect('launch-search', Lang.bind(this, this._onLaunchSearch)); ++ + this._searchProvider.export(connection); + return true; + }, +-- +2.9.4 + + +From af6130bfe229521869f33a125dd4d354f4327ff4 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 8 Jun 2017 16:12:34 +0200 +Subject: [PATCH 15/16] application: Assert that the ShellSearchProvider's + lifetime is sane + +The ShellSearchProvider should be instantiated in the dbus_register +virtual method, which is expected to be called only once. + +https://bugzilla.gnome.org/show_bug.cgi?id=783548 +--- + src/application.js | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/application.js b/src/application.js +index 2630e1971826..1e439815f0b4 100644 +--- a/src/application.js ++++ b/src/application.js +@@ -513,6 +513,9 @@ const Application = new Lang.Class({ + vfunc_dbus_register: function(connection, path) { + this.parent(connection, path); + ++ if (this._searchProvider != null) ++ throw(new Error('ShellSearchProvider already instantiated - dbus_register called twice?')); ++ + this._searchProvider = new ShellSearchProvider.ShellSearchProvider(); + this._searchProvider.connect('activate-result', Lang.bind(this, this._onActivateResult)); + this._searchProvider.connect('launch-search', Lang.bind(this, this._onLaunchSearch)); +-- +2.9.4 + + +From 4d3476a700ecbb5066269f9fb15fc201d134859e Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Thu, 8 Jun 2017 16:58:08 +0200 +Subject: [PATCH 16/16] application: Don't unexport a skeleton that was never + exported + +Otherwise it will again lead to: + GLib-GIO-CRITICAL **: + g_dbus_interface_skeleton_unexport_from_connection: assertion + 'interface_->priv->connections != NULL' failed + +https://bugzilla.gnome.org/show_bug.cgi?id=783548 +--- + src/application.js | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/application.js b/src/application.js +index 1e439815f0b4..f9e8b6ae9863 100644 +--- a/src/application.js ++++ b/src/application.js +@@ -520,7 +520,13 @@ const Application = new Lang.Class({ + this._searchProvider.connect('activate-result', Lang.bind(this, this._onActivateResult)); + this._searchProvider.connect('launch-search', Lang.bind(this, this._onLaunchSearch)); + +- this._searchProvider.export(connection); ++ try { ++ this._searchProvider.export(connection); ++ } catch(e) { ++ this._searchProvider = null; ++ throw(e); ++ } ++ + return true; + }, + +-- +2.9.4 + diff --git a/SOURCES/translations.patch b/SOURCES/translations.patch deleted file mode 100644 index cd5b1ed..0000000 --- a/SOURCES/translations.patch +++ /dev/null @@ -1,254 +0,0 @@ -Index: new/po/bn_IN.po -=================================================================== ---- new.orig/po/bn_IN.po -+++ new/po/bn_IN.po -@@ -27,7 +27,6 @@ msgid "Documents" - msgstr "দস্তাবেজ" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:2 --#| msgid "A document manager application" - msgid "A document manager application for GNOME" - msgstr "GNOME'র জন্য দস্তাবেজ ব্যবস্থাপনার একটি অ্যাপ্লিকেশন" - -@@ -38,10 +37,10 @@ msgid "" - "to deal with documents. Seamless cloud integration is offered through GNOME " - "Online Accounts." - msgstr "" --"GNOME এ অাপনার নথিগুলি অ্যাক্সেস, সংগঠিত এবং ভাগ করার এক অ্যাপ্লিকেশন। " --"নথি নিয়ে কাজ করতে ফাইল ম্যানেজারের ব্যবহার করার থেকে এর ব্যবহার অনেক বেশি সহজ " --"এবং কার্যকর। GNOME " --"অনলাইন অ্যাকাউন্টের মাধ্যমে ঝামেলামুক্ত ভাবে ক্লাউড একত্রিকরণ প্রদান করা হয়।" -+"GNOME এ অাপনার নথিগুলি অ্যাক্সেস, সংগঠিত এবং ভাগ করার এক অ্যাপ্লিকেশন। নথি নিয়ে " -+"কাজ করতে ফাইল ম্যানেজারের ব্যবহার করার থেকে এর ব্যবহার অনেক বেশি সহজ এবং " -+"কার্যকর। GNOME অনলাইন অ্যাকাউন্টের মাধ্যমে ঝামেলামুক্ত ভাবে ক্লাউড একত্রিকরণ প্রদান " -+"করা হয়।" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:4 - msgid "It lets you:" -@@ -68,20 +67,16 @@ msgid "View documents fullscreen" - msgstr "নথিগুলি সম্পূর্ণ-স্ক্রিনে দেখুন" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:10 --#| msgid "PDF Documents" - msgid "Print documents" - msgstr "দস্তাবেজগুলি মুদ্রণ করুন" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:11 --#| msgid "Select Items" - msgid "Select favorites" - msgstr "পছন্দসই নির্বাচন করুন" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:12 - msgid "Allow opening full featured editor for non-trivial changes" --msgstr "" --"বিস্তারিত পরিবর্তনের ক্ষেত্রে সম্পূর্ণ বৈশিষ্ট সমন্বিত সম্পাদক খোলার অনুমতি " --"দিন" -+msgstr "বিস্তারিত পরিবর্তনের ক্ষেত্রে সম্পূর্ণ বৈশিষ্ট সমন্বিত সম্পাদক খোলার অনুমতি দিন" - - #: ../data/org.gnome.Documents.desktop.in.h:2 - msgid "Access, manage and share documents" -@@ -124,7 +119,6 @@ msgid "Window maximized state" - msgstr "পূর্ণবিস্তারিত উইন্ডো রূপ" - - #: ../src/documents.js:621 --#| msgid "Unable to load the document" - msgid "Failed to print document" - msgstr "ডকুমেন্ট প্রিন্ট করতে ব্যর্থ" - -@@ -213,7 +207,6 @@ msgid "You can add your online accounts - msgstr "আপনি %s - এ আপনার অনলাইন অ্যাকাউন্ট যোগ করতে পারেন" - - #: ../src/embed.js:167 --#| msgid "System Settings" - msgid "Settings" - msgstr "সেটিংস" - -@@ -376,7 +369,6 @@ msgid "Present On" - msgstr "এতে উপস্থিত" - - #: ../src/preview.js:594 --#| msgid "Bookmarks" - msgid "Bookmark this page" - msgstr "এই পৃষ্ঠা বুকমার্ক করুন" - -@@ -399,13 +391,11 @@ msgid "Properties" - msgstr "বৈশিষ্ট্যাবলী" - - #: ../src/properties.js:81 --#| msgid "Title" - msgctxt "Document Title" - msgid "Title" - msgstr "শিরোনাম" - - #: ../src/properties.js:90 --#| msgid "Author" - msgctxt "Document Author" - msgid "Author" - msgstr "লেখক" -@@ -423,7 +413,6 @@ msgid "Date Created" - msgstr "নির্মান তারিখ" - - #: ../src/properties.js:119 --#| msgid "Type" - msgctxt "Document Type" - msgid "Type" - msgstr "প্রকার" -@@ -507,7 +496,6 @@ msgid "Shared with you" - msgstr "আপনার সাথে শেয়ার করা" - - #: ../src/search.js:177 --#| msgid "Type" - msgctxt "Search Filter" - msgid "Type" - msgstr "প্রকার" -@@ -537,13 +525,11 @@ msgid "Match" - msgstr "মেলান" - - #: ../src/search.js:268 --#| msgid "Title" - msgctxt "Search Filter" - msgid "Title" - msgstr "শিরোনাম" - - #: ../src/search.js:271 --#| msgid "Author" - msgctxt "Search Filter" - msgid "Author" - msgstr "লেখক" -@@ -557,12 +543,10 @@ msgid "You don't have any collections ye - msgstr "এখনও পর্যন্ত অাপনার কোনো সংগ্রহ নেই। উপরে একটি নতুন সংগ্রহ নাম দিন।" - - #: ../src/selections.js:604 --#| msgid "Collection" - msgid "Create new collection" - msgstr "নতুন সংগ্রহ তৈরি করুন" - - #: ../src/selections.js:640 --#| msgid "Collections" - msgctxt "Dialog Title" - msgid "Collections" - msgstr "সংগ্রহসমূহ" -@@ -580,7 +564,6 @@ msgid "Share" - msgstr "ভাগ করুন" - - #: ../src/selections.js:772 --#| msgid "Collection" - msgid "Add to Collection" - msgstr "সংগ্রহে যোগ করুন" - -@@ -659,7 +642,6 @@ msgid "Untitled Document" - msgstr "শিরোনামহীন দস্তাবেজ" - - #: ../src/trackerController.js:170 --#| msgid "Unable to locate this document." - msgid "Unable to fetch the list of documents" - msgstr "নথিগুলির তালিকা নিয়ে অাসা গেল না" - -Index: new/po/ta.po -=================================================================== ---- new.orig/po/ta.po -+++ new/po/ta.po -@@ -38,12 +38,9 @@ msgid "" - "to deal with documents. Seamless cloud integration is offered through GNOME " - "Online Accounts." - msgstr "" --"GNOME இல் உங்கள் ஆவணங்களை அணுகவும் ஒழுங்கமைக்கவும் பகிரவும் உதவும் ஒரு எளிய " --"பயன்பாடு. " --"இது ஆவணங்களைக் கையாள கோப்பு நிர்வாகியைப் பயன்படுத்துவதற்கு பதிலாக " --"உருவாக்கப்பட்ட ஒரு " --"எளியதும் அற்புதமானதுமான ஒரு கருவி. GNOME ஆன்லைன் கணக்குகளுடன் சிக்கலற்ற " --"ஒத்திசைவு " -+"GNOME இல் உங்கள் ஆவணங்களை அணுகவும் ஒழுங்கமைக்கவும் பகிரவும் உதவும் ஒரு எளிய பயன்பாடு. " -+"இது ஆவணங்களைக் கையாள கோப்பு நிர்வாகியைப் பயன்படுத்துவதற்கு பதிலாக உருவாக்கப்பட்ட ஒரு " -+"எளியதும் அற்புதமானதுமான ஒரு கருவி. GNOME ஆன்லைன் கணக்குகளுடன் சிக்கலற்ற ஒத்திசைவு " - "வசதியையும் இது வழங்குகிறது." - - #: ../data/org.gnome.Documents.appdata.xml.in.h:4 -@@ -71,19 +68,16 @@ msgid "View documents fullscreen" - msgstr "ஆவணங்களை முழுத்திரையில் காணலாம்" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:10 --#| msgid "PDF Documents" - msgid "Print documents" - msgstr "ஆவணங்களை அச்சிடலாம்" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:11 --#| msgid "Select Items" - msgid "Select favorites" - msgstr "பிடித்தவற்றைத் தேர்ந்தெடுக்கலாம்" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:12 - msgid "Allow opening full featured editor for non-trivial changes" --msgstr "" --"மிக முக்கியமல்லாத மாற்றங்களுக்கு முழு வசதி கொண்ட திருத்தியைத் திறக்க அனுமதி" -+msgstr "மிக முக்கியமல்லாத மாற்றங்களுக்கு முழு வசதி கொண்ட திருத்தியைத் திறக்க அனுமதி" - - #: ../data/org.gnome.Documents.desktop.in.h:2 - msgid "Access, manage and share documents" -@@ -126,7 +120,6 @@ msgid "Window maximized state" - msgstr "முழுமையாக்கிய சாளர நிலை" - - #: ../src/documents.js:621 --#| msgid "Unable to load the document" - msgid "Failed to print document" - msgstr "ஆவணத்தை அச்சிட முடியவில்லை" - -@@ -215,7 +208,6 @@ msgid "You can add your online accounts - msgstr "நீங்கள் %s இல் உங்கள் இணைய கணக்குகளை சேர்க்கலாம் " - - #: ../src/embed.js:167 --#| msgid "System Settings" - msgid "Settings" - msgstr "அமைவுகள்" - -@@ -349,8 +341,7 @@ msgstr "விடுவி (_U)" - #: ../src/password.js:65 - #, javascript-format - msgid "Document %s is locked and requires a password to be opened." --msgstr "" --"ஆவணம் %s பூட்டப்பட்டுள்ளது, அதனை திறப்பதற்கு கடவுச்சொல் தேவைப்படுகிறது." -+msgstr "ஆவணம் %s பூட்டப்பட்டுள்ளது, அதனை திறப்பதற்கு கடவுச்சொல் தேவைப்படுகிறது." - - #: ../src/password.js:79 - msgid "_Password" -@@ -536,9 +527,7 @@ msgstr "மூலங்கள் " - - #: ../src/selections.js:461 - msgid "You don't have any collections yet. Enter a new collection name above." --msgstr "" --"உங்களிடம் தொகுப்புகள் எதுவும் இல்லை. மேலே ஒரு புதிய தொகுப்பின் பெயரை " --"உள்ளிடவும்." -+msgstr "உங்களிடம் தொகுப்புகள் எதுவும் இல்லை. மேலே ஒரு புதிய தொகுப்பின் பெயரை உள்ளிடவும்." - - #: ../src/selections.js:604 - msgid "Create new collection" -Index: new/po/zh_TW.po -=================================================================== ---- new.orig/po/zh_TW.po -+++ new/po/zh_TW.po -@@ -64,12 +64,10 @@ msgid "View documents fullscreen" - msgstr "全螢幕檢視文件" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:10 --#| msgid "PDF Documents" - msgid "Print documents" - msgstr "列印文件" - - #: ../data/org.gnome.Documents.appdata.xml.in.h:11 --#| msgid "Select Items" - msgid "Select favorites" - msgstr "選擇喜好" - -@@ -672,12 +670,6 @@ msgid "%d year ago" - msgid_plural "%d years ago" - msgstr[0] "%d 年以前" - --#~| msgid "" --#~| "
  • View recent local and online documents
  • Access your Google, " --#~| "ownCloud or SkyDrive content
  • Search through documents
  • " --#~| "
  • See new documents shared by friends
  • View documents " --#~| "fullscreen
  • Print documents
  • Select favorites
  • " --#~| "
  • Allow opening full featured editor for non-trivial changes
  • " - #~ msgid "" - #~ "
  • View recent local and online documents
  • Access your Google, " - #~ "ownCloud or OneDrive content
  • Search through documents
  • " diff --git a/SPECS/gnome-documents.spec b/SPECS/gnome-documents.spec index a5e2a2e..fa178cc 100644 --- a/SPECS/gnome-documents.spec +++ b/SPECS/gnome-documents.spec @@ -1,34 +1,42 @@ %define evince_version 3.13.3 -%define gtk3_version 3.13.2 +%define gnome_online_miners_version 3.22.0-2 +%define gtk3_version 3.19.1 Name: gnome-documents -Version: 3.14.3 -Release: 3%{?dist} +Version: 3.22.2 +Release: 5%{?dist} Summary: A document manager application for GNOME License: GPLv2+ -URL: https://live.gnome.org/Design/Apps/Documents -Source0: http://download.gnome.org/sources/%{name}/3.14/%{name}-%{version}.tar.xz - -# https://bugzilla.redhat.com/show_bug.cgi?id=1057160 -Patch0: gnome-documents-show-a-back-button-while-loading.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=958690 -Patch1: gnome-documents-prevent-nested-collections.patch - -Patch100: translations.patch - -BuildRequires: evince-devel >= %{evince_version} -BuildRequires: gtk3-devel >= %{gtk3_version} +URL: https://wiki.gnome.org/Apps/Documents +Source0: https://download.gnome.org/sources/%{name}/3.22/%{name}-%{version}.tar.xz + +# https://bugzilla.redhat.com/show_bug.cgi?id=985887 +# https://bugzilla.redhat.com/show_bug.cgi?id=1436566 +# https://bugzilla.redhat.com/show_bug.cgi?id=1436682 +# https://bugzilla.redhat.com/show_bug.cgi?id=1438362 +# https://bugzilla.redhat.com/show_bug.cgi?id=1444437 +Patch0: gnome-documents-skydrive-printing-and-lok-fixes.patch + +BuildRequires: autoconf automake libtool +BuildRequires: gnome-common +BuildRequires: yelp-tools +BuildRequires: pkgconfig(evince-document-3.0) >= %{evince_version} +BuildRequires: pkgconfig(evince-view-3.0) >= %{evince_version} +BuildRequires: pkgconfig(webkit2gtk-4.0) +BuildRequires: pkgconfig(gtk+-3.0) >= %{gtk3_version} +BuildRequires: pkgconfig(gjs-1.0) +BuildRequires: pkgconfig(tracker-control-1.0) >= 0.17.0 +BuildRequires: pkgconfig(tracker-sparql-1.0) >= 0.17.0 +BuildRequires: pkgconfig(goa-1.0) +BuildRequires: pkgconfig(gnome-desktop-3.0) +BuildRequires: pkgconfig(libgdata) +BuildRequires: pkgconfig(libgepub) +BuildRequires: pkgconfig(zapojit-0.0) +BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: intltool -BuildRequires: libgdata-devel -BuildRequires: gnome-desktop3-devel BuildRequires: liboauth-devel -BuildRequires: gnome-online-accounts-devel -BuildRequires: tracker-devel >= 0.17.0 BuildRequires: desktop-file-utils -BuildRequires: gjs-devel -BuildRequires: libzapojit-devel -BuildRequires: webkitgtk3-devel BuildRequires: itstool BuildRequires: inkscape BuildRequires: poppler-utils @@ -36,35 +44,51 @@ BuildRequires: docbook-style-xsl Requires: evince-libs%{?_isa} >= %{evince_version} Requires: gtk3%{?_isa} >= %{gtk3_version} -Requires: gnome-online-miners +Requires: gnome-online-miners >= %{gnome_online_miners_version} +Requires: libgepub%{?_isa} +Requires: libreofficekit +Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description gnome-documents is a document manager application for GNOME, aiming to be a simple and elegant replacement for using Files to show the Documents directory. +%package libs +Summary: Common libraries and data files for %{name} +%description libs +%{summary}. + %prep %setup -q -%patch0 -p1 -b .back-button-loading -%patch1 -p1 -b .nested-collections -%patch100 -p1 -b .translations +%patch0 -p1 %build +autoreconf --force --install %configure --disable-static --enable-getting-started make %{?_smp_mflags} %install -make install DESTDIR=$RPM_BUILD_ROOT +%make_install find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' + +# Disable gnome-books +rm -f $RPM_BUILD_ROOT/%{_bindir}/gnome-books +rm -f $RPM_BUILD_ROOT/%{_datadir}/dbus-1/services/org.gnome.Books.service +rm -f $RPM_BUILD_ROOT/%{_datadir}/glib-2.0/schemas/org.gnome.books.gschema.xml +rm -f $RPM_BUILD_ROOT/%{_datadir}/applications/org.gnome.Books.desktop +rm -f $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/*/apps/org.gnome.Books.png +rm -f $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Books-symbolic.svg +rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/gnome-books.1* +rm -f $RPM_BUILD_ROOT/%{_datadir}/appdata/org.gnome.Books.appdata.xml + desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/org.gnome.Documents.desktop %find_lang %{name} --with-gnome - %post /sbin/ldconfig touch --no-create %{_datadir}/icons/hicolor >&/dev/null || : - %postun /sbin/ldconfig if [ $1 -eq 0 ] ; then @@ -78,22 +102,57 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %files -f %{name}.lang -%doc README AUTHORS NEWS TODO COPYING -%{_datadir}/%{name} +%license COPYING +%doc README AUTHORS NEWS TODO %{_bindir}/%{name} %{_datadir}/appdata/org.gnome.Documents.appdata.xml -%{_datadir}/dbus-1/services/* -%{_datadir}/glib-2.0/schemas/* -%{_datadir}/applications/* -%{_datadir}/icons/hicolor/*/apps/gnome-documents.png -%{_libdir}/gnome-documents/ -%{_mandir}/man1/%{name}.1.gz +%{_datadir}/dbus-1/services/org.gnome.Documents.service +%{_datadir}/glib-2.0/schemas/org.gnome.documents.gschema.xml +%{_datadir}/applications/org.gnome.Documents.desktop +%{_datadir}/icons/hicolor/*/apps/org.gnome.Documents.png +%{_datadir}/icons/hicolor/scalable/apps/org.gnome.Documents-symbolic.svg +%{_mandir}/man1/gnome-documents.1* # co-own these directories %dir %{_datadir}/gnome-shell %dir %{_datadir}/gnome-shell/search-providers %{_datadir}/gnome-shell/search-providers/org.gnome.Documents.search-provider.ini +%files libs +%{_datadir}/%{name} +%{_datadir}/glib-2.0/schemas/org.gnome.Documents.enums.xml +%{_libdir}/gnome-documents/ + %changelog +* Fri Jun 09 2017 Debarshi Ray - 3.22.2-5 +- Fix CRITICALs on invoking the application when a primary instance is present + Resolves: #1436566 + +* Thu May 11 2017 Debarshi Ray - 3.22.2-4 +- Fix crash on repeated opening of presentations + Resolves: #1444437 + +* Fri Apr 21 2017 Debarshi Ray - 3.22.2-3 +- Disable the print button in the selection toolbar when printing isn't + supported + Resolves: #1438362 + +* Tue Apr 04 2017 Debarshi Ray - 3.22.2-2 +- Unable to preview LOKDocView-supported documents from OneDrive + Resolves: #1436682 + +* Mon Mar 27 2017 Debarshi Ray - 3.22.2-1 +- Update to 3.22.2 +- Thumbnail OneDrive entries once they are loaded + Resolves: #985887, #1386892 + +* Wed Mar 22 2017 Debarshi Ray - 3.22.1-2 +- Drop gnome-books due to unavailability of gnome-epub-thumbnailer + Resolves: #1433418 + +* Sun Mar 12 2017 Debarshi Ray - 3.22.1-1 +- Update to 3.22.1 + Resolves: #1386892 + * Wed Jun 15 2016 Debarshi Ray - 3.14.3-3 - Prevent nested collections Resolves: #958690