[gnome-documents/wip/hadess/remove-books] Remove gnome-books
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/hadess/remove-books] Remove gnome-books
- Date: Fri, 25 Jan 2019 16:46:18 +0000 (UTC)
commit 9fc73c99c791bd2d044ab4e80557ea3d8cb7a012
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 25 17:45:20 2019 +0100
Remove gnome-books
It's now available from its own module.
.gitlab-ci.yml | 12 -
.../hicolor/scalable/apps/org.gnome.Books.svg | 251 ------------------
.../symbolic/apps/org.gnome.Books-symbolic.svg | 27 --
data/meson.build | 1 -
data/org.gnome.Books.appdata.xml.in | 74 ------
data/org.gnome.Books.data.gresource.xml | 1 -
data/org.gnome.Books.desktop.in | 14 --
data/org.gnome.Documents.data.gresource.xml | 4 -
data/org.gnome.books.gschema.xml | 34 ---
data/screenshots/gnome-books-1.png | Bin 772100 -> 0 bytes
data/screenshots/gnome-books-2.png | Bin 650043 -> 0 bytes
data/screenshots/gnome-books-3.png | Bin 865341 -> 0 bytes
data/ui/books-app-menu.ui | 24 --
flatpak/org.gnome.Books.json | 219 ----------------
flatpak/org.gnome.Documents.json | 13 +-
man/gnome-books.xml | 65 -----
man/meson.build | 1 -
meson.build | 2 -
meson_post_install.py | 1 -
po/POTFILES.in | 5 -
src/application.js | 36 +--
src/documents.js | 31 +--
src/embed.js | 5 -
src/epubview.js | 279 ---------------------
src/evinceview.js | 18 +-
src/lib/gd-utils.c | 20 +-
src/lib/gd-utils.h | 3 +-
src/main.js | 3 +-
src/mainToolbar.js | 8 +-
src/mainWindow.js | 4 +-
src/meson.build | 1 -
src/org.gnome.Books.service.in | 3 -
src/org.gnome.Books.src.gresource.xml | 38 ---
src/org.gnome.Documents.src.gresource.xml | 1 -
src/overview.js | 16 +-
src/preview.js | 5 -
src/query.js | 10 +-
src/search.js | 90 +++----
src/selections.js | 19 +-
src/windowMode.js | 7 +-
40 files changed, 72 insertions(+), 1273 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2806ce3a..7dd30fbc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -13,15 +13,3 @@ flatpak-documents:
RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
APP_ID: "org.gnome.Documents"
extends: .flatpak
-
-
-flatpak-books:
- image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
- variables:
- BUNDLE: "gnome-books-dev.flatpak"
- MANIFEST_PATH: "flatpak/org.gnome.Books.json"
- #MESON_ARGS: "-Dprofile=development"
- FLATPAK_MODULE: "gnome-books"
- RUNTIME_REPO: "https://sdk.gnome.org/gnome-nightly.flatpakrepo"
- APP_ID: "org.gnome.Books"
- extends: .flatpak
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
index 5450d2d7..3458d865 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -26,7 +26,6 @@ resource_data = files(
'media/dnd-counter.svg',
'media/thumbnail-frame.png',
'ui/documents-app-menu.ui',
- 'ui/books-app-menu.ui',
'ui/help-overlay.ui',
'ui/help-overlay.ui',
'ui/organize-collection-dialog.ui',
diff --git a/data/org.gnome.Documents.data.gresource.xml b/data/org.gnome.Documents.data.gresource.xml
index 49cf01dd..1161341c 100644
--- a/data/org.gnome.Documents.data.gresource.xml
+++ b/data/org.gnome.Documents.data.gresource.xml
@@ -2,7 +2,6 @@
<gresources>
<gresource prefix="/org/gnome/Documents">
<file>application.css</file>
- <file preprocess="xml-stripblanks">ui/books-app-menu.ui</file>
<file preprocess="xml-stripblanks">ui/documents-app-menu.ui</file>
<file preprocess="xml-stripblanks">ui/organize-collection-dialog.ui</file>
<file preprocess="xml-stripblanks">ui/preview-context-menu.ui</file>
@@ -16,7 +15,4 @@
<gresource prefix="/org/gnome/Documents/gtk">
<file alias="help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
</gresource>
- <gresource prefix="/org/gnome/Books/gtk">
- <file alias="help-overlay.ui" preprocess="xml-stripblanks">ui/help-overlay.ui</file>
- </gresource>
</gresources>
diff --git a/flatpak/org.gnome.Documents.json b/flatpak/org.gnome.Documents.json
index b6e88f3f..3e396266 100644
--- a/flatpak/org.gnome.Documents.json
+++ b/flatpak/org.gnome.Documents.json
@@ -34,8 +34,7 @@
"/share/pkgconfig", "/share/aclocal",
"/man", "/share/man", "/share/gtk-doc",
"/share/vala",
- "*.la", "*.a",
- "/bin/gnome-books"],
+ "*.la", "*.a"],
"modules": [
{
"name": "librest",
@@ -185,16 +184,6 @@
}
]
},
- {
- "name": "libgepub",
- "buildsystem": "meson",
- "sources": [
- {
- "type": "git",
- "url": "https://gitlab.gnome.org/GNOME/libgepub.git"
- }
- ]
- },
{
"name": "gnome-documents",
"buildsystem": "meson",
diff --git a/man/meson.build b/man/meson.build
index 5ff52241..ef7a764a 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -16,7 +16,6 @@ xsltproc_cmd = [
mans = [
'gnome-documents',
- 'gnome-books'
]
foreach man: mans
diff --git a/meson.build b/meson.build
index c6fdb563..75e4b406 100644
--- a/meson.build
+++ b/meson.build
@@ -15,7 +15,6 @@ documents_api_version = '1.0'
documents_gir_version = '1.0'
documents_apps = [
- 'org.gnome.Books',
'org.gnome.Documents'
]
@@ -77,7 +76,6 @@ documents_deps = [
# we just check their existence for gir
dependency('libgdata')
-dependency('libgepub-0.6')
dependency('goa-1.0')
dependency('zapojit-0.0')
diff --git a/meson_post_install.py b/meson_post_install.py
index 844888f8..eabcc4f2 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -14,7 +14,6 @@ bindir = os.path.normpath(destdir + os.sep + sys.argv[2])
# FIXME: meson will not track the creation of these files
# https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
apps = [
- ['org.gnome.Books', 'gnome-books'],
['org.gnome.Documents', 'gnome-documents']
]
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a3da1d41..af2e2de6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,12 +1,8 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
-data/org.gnome.Books.appdata.xml.in
-data/org.gnome.Books.desktop.in
-data/org.gnome.books.gschema.xml
data/org.gnome.Documents.appdata.xml.in
data/org.gnome.Documents.desktop.in
data/org.gnome.documents.gschema.xml
-data/ui/books-app-menu.ui
data/ui/documents-app-menu.ui
data/ui/help-overlay.ui
data/ui/organize-collection-dialog.ui
@@ -19,7 +15,6 @@ src/application.js
src/documents.js
src/edit.js
src/embed.js
-src/epubview.js
src/evinceview.js
src/lib/gd-nav-bar.c
src/lib/gd-pdf-loader.c
diff --git a/src/application.js b/src/application.js
index e3b286cb..f336ef72 100644
--- a/src/application.js
+++ b/src/application.js
@@ -99,22 +99,15 @@ var Application = new Lang.Class({
'miners-changed': {}
},
- _init: function(isBooks) {
+ _init: function() {
this.minersRunning = [];
this._activationTimestamp = Gdk.CURRENT_TIME;
this._extractPriority = null;
this._searchProvider = null;
- this.isBooks = isBooks;
-
let appid;
- if (this.isBooks) {
- GLib.set_application_name(_("Books"));
- appid = 'org.gnome.Books';
- } else {
- GLib.set_application_name(_("Documents"));
- appid = 'org.gnome.Documents';
- }
+ GLib.set_application_name(_("Documents"));
+ appid = 'org.gnome.Documents';
// needed by data/ui/view-menu.ui
GObject.type_ensure(Gio.ThemedIcon);
@@ -183,7 +176,7 @@ var Application = new Lang.Class({
},
_onActionAbout: function() {
- this._mainWindow.showAbout(this.isBooks);
+ this._mainWindow.showAbout();
},
_onActionHelp: function() {
@@ -349,11 +342,7 @@ var Application = new Lang.Class({
EvDoc.init();
- application = this;
- if (application.isBooks)
- settings = new Gio.Settings({ schema_id: 'org.gnome.books' });
- else
- settings = new Gio.Settings({ schema_id: 'org.gnome.documents' });
+ settings = new Gio.Settings({ schema_id: 'org.gnome.documents' });
let gtkSettings = Gtk.Settings.get_default();
gtkSettings.connect('notify::gtk-theme-name', Lang.bind(this, this._themeChanged));
@@ -367,13 +356,11 @@ var Application = new Lang.Class({
return;
}
- if (!application.isBooks) {
- try {
- goaClient = Goa.Client.new_sync(null);
- } catch (e) {
- logError(e, 'Unable to create the GOA client');
- return;
- }
+ try {
+ goaClient = Goa.Client.new_sync(null);
+ } catch (e) {
+ logError(e, 'Unable to create the GOA client');
+ return;
}
connectionQueue = new TrackerController.TrackerConnectionQueue();
@@ -414,8 +401,7 @@ var Application = new Lang.Class({
if (this._mainWindow)
return;
- if (!this.isBooks)
- this._initGettingStarted();
+ this._initGettingStarted();
notificationManager = new Notifications.NotificationManager();
this._mainWindow = new MainWindow.MainWindow(this);
diff --git a/src/documents.js b/src/documents.js
index a5c25fc7..a8e385c1 100644
--- a/src/documents.js
+++ b/src/documents.js
@@ -22,7 +22,6 @@
const EvDocument = imports.gi.EvinceDocument;
const EvView = imports.gi.EvinceView;
const LOKView = imports.lokview;
-const EPUBView = imports.epubview;
const GdkPixbuf = imports.gi.GdkPixbuf;
const Gio = imports.gi.Gio;
const Gd = imports.gi.Gd;
@@ -709,17 +708,7 @@ const DocCommon = new Lang.Class({
loadLocal: function(passwd, cancellable, callback) {
Utils.debug('Loading ' + this.__name__ + ' ' + this.id + ' from ' + this.uriToLoad);
- if (this.mimeType == 'application/x-mobipocket-ebook' ||
- this.mimeType == 'application/x-fictionbook+xml' ||
- this.mimeType == 'application/x-zip-compressed-fb2') {
- let exception = new GLib.Error(Gio.IOErrorEnum,
- Gio.IOErrorEnum.NOT_SUPPORTED,
- "Internal error: Ebooks preview isn't support yet");
- callback(this, null, exception);
- return;
- }
-
- if (LOKView.isOpenDocumentFormat(this.mimeType) && !Application.application.isBooks) {
+ if (LOKView.isOpenDocumentFormat(this.mimeType)) {
let exception = null;
if (!LOKView.isAvailable()) {
exception = new GLib.Error(Gio.IOErrorEnum,
@@ -730,11 +719,6 @@ const DocCommon = new Lang.Class({
return;
}
- if (EPUBView.isEpub(this.mimeType) && Application.application.isBooks) {
- callback(this, null, null);
- return;
- }
-
GdPrivate.pdf_loader_load_uri_async(this.uriToLoad, passwd, cancellable, Lang.bind(this,
function(source, res) {
try {
@@ -1131,8 +1115,6 @@ const GoogleDocument = new Lang.Class({
description = _("Spreadsheet");
else if (this.rdfType.indexOf('nfo#Presentation') != -1)
description = _("Presentation");
- else if (this.rdfType.indexOf('nfo#EBook') != -1)
- description = _("e-Book");
else
description = _("Document");
@@ -1428,8 +1410,6 @@ const SkydriveDocument = new Lang.Class({
description = _("Spreadsheet");
else if (this.rdfType.indexOf('nfo#Presentation') != -1)
description = _("Presentation");
- else if (this.rdfType.indexOf('nfo#EBook') != -1)
- description = _("e-Book");
else
description = _("Document");
@@ -1623,10 +1603,7 @@ var DocumentManager = new Lang.Class({
} else if (error.domain == Gio.IOErrorEnum) {
switch (error.code) {
case Gio.IOErrorEnum.NOT_SUPPORTED:
- if (Application.application.isBooks)
- message = _("You are using a preview of Books. Full viewing capabilities are coming
soon!");
- else
- message = _("LibreOffice support is not available. Please contact your system
administrator.");
+ message = _("LibreOffice support is not available. Please contact your system
administrator.");
break;
default:
break;
@@ -1667,10 +1644,8 @@ var DocumentManager = new Lang.Class({
_requestPreview: function(doc) {
let windowMode;
- if (LOKView.isOpenDocumentFormat(doc.mimeType) && !Application.application.isBooks) {
+ if (LOKView.isOpenDocumentFormat(doc.mimeType)) {
windowMode = WindowMode.WindowMode.PREVIEW_LOK;
- } else if (EPUBView.isEpub(doc.mimeType) && Application.application.isBooks) {
- windowMode = WindowMode.WindowMode.PREVIEW_EPUB;
} else {
windowMode = WindowMode.WindowMode.PREVIEW_EV;
}
diff --git a/src/embed.js b/src/embed.js
index c207f791..8fd36809 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -23,7 +23,6 @@ const Lang = imports.lang;
const Mainloop = imports.mainloop;
const Application = imports.application;
-const EPUBView = imports.epubview;
const Edit = imports.edit;
const EvinceView = imports.evinceview;
const LOKView = imports.lokview;
@@ -72,9 +71,6 @@ const View = new Lang.Class({
case WindowMode.WindowMode.PREVIEW_LOK:
constructor = LOKView.LOKView;
break;
- case WindowMode.WindowMode.PREVIEW_EPUB:
- constructor = EPUBView.EPUBView;
- break;
case WindowMode.WindowMode.EDIT:
constructor = Edit.EditView;
break;
@@ -112,7 +108,6 @@ const View = new Lang.Class({
break;
case WindowMode.WindowMode.PREVIEW_EV:
case WindowMode.WindowMode.PREVIEW_LOK:
- case WindowMode.WindowMode.PREVIEW_EPUB:
case WindowMode.WindowMode.EDIT:
this._createPreview(mode);
this._stack.visible_child = this._preview;
diff --git a/src/evinceview.js b/src/evinceview.js
index 4d077f69..1ab4c55d 100644
--- a/src/evinceview.js
+++ b/src/evinceview.js
@@ -198,12 +198,11 @@ var EvinceView = new Lang.Class({
accels: ['Page_Down'] }
];
- if (!Application.application.isBooks)
- actions.push({ name: 'present-current',
- callback: Utils.actionToggleCallback,
- state: GLib.Variant.new('b', false),
- stateChanged: Lang.bind(this, this._presentStateChanged),
- accels: ['F5'] });
+ actions.push({ name: 'present-current',
+ callback: Utils.actionToggleCallback,
+ state: GLib.Variant.new('b', false),
+ stateChanged: Lang.bind(this, this._presentStateChanged),
+ accels: ['F5'] });
return actions;
},
@@ -261,10 +260,7 @@ var EvinceView = new Lang.Class({
this.parent(manager, doc, docModel);
- if (Application.application.isBooks)
- docModel.set_sizing_mode(EvView.SizingMode.FIT_PAGE);
- else
- docModel.set_sizing_mode(EvView.SizingMode.AUTOMATIC);
+ docModel.set_sizing_mode(EvView.SizingMode.AUTOMATIC);
docModel.set_continuous(false);
docModel.set_page_layout(EvView.PageLayout.AUTOMATIC);
@@ -570,7 +566,7 @@ var EvinceView = new Lang.Class({
},
set nightMode(v) {
- if (this._model && !Application.application.isBooks)
+ if (this._model)
this._model.set_inverted_colors(v);
}
});
diff --git a/src/lib/gd-utils.c b/src/lib/gd-utils.c
index bc40059a..d5536865 100644
--- a/src/lib/gd-utils.c
+++ b/src/lib/gd-utils.c
@@ -300,8 +300,7 @@ gd_ev_view_find_changed (EvView *view,
}
void
-gd_show_about_dialog (GtkWindow *parent,
- gboolean is_books)
+gd_show_about_dialog (GtkWindow *parent)
{
GApplication *app;
@@ -318,29 +317,18 @@ gd_show_about_dialog (GtkWindow *parent,
NULL
};
- const char *app_id, *comments, *website;
+ const char *app_id;
app = g_application_get_default ();
app_id = g_application_get_application_id (app);
- if(!is_books)
- {
- comments = _("A document manager application");
- website = "https://wiki.gnome.org/Apps/Documents";
- }
- else
- {
- comments = _("An e-books manager application");
- website = "https://wiki.gnome.org/Apps/Books";
- }
-
gtk_show_about_dialog (parent,
"artists", artists,
"authors", authors,
"translator-credits", _("translator-credits"),
- "comments", comments,
+ "comments", _("A document manager application"),
"logo-icon-name", app_id,
- "website", website,
+ "website", "https://wiki.gnome.org/Apps/Documents",
"copyright", "Copyright © 2011-2014 Red Hat, Inc.",
"license-type", GTK_LICENSE_GPL_2_0,
"version", PACKAGE_VERSION,
diff --git a/src/lib/gd-utils.h b/src/lib/gd-utils.h
index b05fcb3b..536a3b9f 100644
--- a/src/lib/gd-utils.h
+++ b/src/lib/gd-utils.h
@@ -44,8 +44,7 @@ void gd_ev_view_find_changed (EvView *view,
EvJobFind *job,
gint page);
-void gd_show_about_dialog (GtkWindow *parent,
- gboolean is_books);
+void gd_show_about_dialog (GtkWindow *parent);
#endif /* __GD_UTILS_H__ */
diff --git a/src/main.js b/src/main.js
index 2aceb54e..b4afb261 100644
--- a/src/main.js
+++ b/src/main.js
@@ -28,7 +28,6 @@ pkg.initSubmodule('src');
pkg.require({ 'EvinceDocument': '3.0',
'Gd': '1.0',
'GdPrivate': '1.0',
- 'Gepub': '0.6',
'Gio': '2.0',
'GLib': '2.0',
'Goa': '1.0',
@@ -42,7 +41,7 @@ const Application = imports.application;
const GLib = imports.gi.GLib;
function main(args) {
- let application = new Application.Application(pkg.name == 'org.gnome.Books');
+ let application = new Application.Application();
if (GLib.getenv('DOCUMENTS_PERSIST'))
application.hold();
return application.run(args);
diff --git a/src/mainToolbar.js b/src/mainToolbar.js
index 53fc6c01..8cbf88bf 100644
--- a/src/mainToolbar.js
+++ b/src/mainToolbar.js
@@ -87,15 +87,9 @@ var MainToolbar = new Lang.Class({
},
addMenuButton: function() {
- let path = null;
let model_name = null;
- if (pkg.name == 'org.gnome.Books') {
- path = "/org/gnome/Documents/ui/books-app-menu.ui";
- } else {
- path = "/org/gnome/Documents/ui/documents-app-menu.ui";
- }
- let builder = Gtk.Builder.new_from_resource(path);
+ let builder = Gtk.Builder.new_from_resource("/org/gnome/Documents/ui/documents-app-menu.ui");
let model = builder.get_object('app-menu');
let menuButton = new Gtk.MenuButton({ image: new Gtk.Image ({ icon_name: 'open-menu-symbolic' }),
tooltip_text: Gettext.pgettext("menu button tooltip", "Menu"),
diff --git a/src/mainWindow.js b/src/mainWindow.js
index e984a4d2..505a91ea 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -163,7 +163,7 @@ var MainWindow = new Lang.Class({
return false;
},
- showAbout: function(isBooks) {
- GdPrivate.show_about_dialog(this, isBooks);
+ showAbout: function() {
+ GdPrivate.show_about_dialog(this);
}
});
diff --git a/src/meson.build b/src/meson.build
index 4016ce8d..cbc883bf 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -46,7 +46,6 @@ resource_data = files(
'documents.js',
'edit.js',
'embed.js',
- 'epubview.js',
'errorBox.js',
'evinceview.js',
'fullscreenAction.js',
diff --git a/src/org.gnome.Documents.src.gresource.xml b/src/org.gnome.Documents.src.gresource.xml
index 6ec63b7a..53d74ae1 100644
--- a/src/org.gnome.Documents.src.gresource.xml
+++ b/src/org.gnome.Documents.src.gresource.xml
@@ -6,7 +6,6 @@
<file>documents.js</file>
<file>edit.js</file>
<file>lokview.js</file>
- <file>epubview.js</file>
<file>embed.js</file>
<file>errorBox.js</file>
<file>fullscreenAction.js</file>
diff --git a/src/overview.js b/src/overview.js
index 6ee5f5b1..f6a86aa4 100644
--- a/src/overview.js
+++ b/src/overview.js
@@ -274,7 +274,7 @@ const EmptyResultsBox = new Lang.Class({
if (this._mode == WindowMode.WindowMode.COLLECTIONS)
text = _("No collections found");
else
- text = Application.application.isBooks ? _("No books found") : _("No documents found");
+ text = _("No documents found");
this.add(new Gtk.Label({ label: '<b><span size="large">' + text + '</span></b>',
use_markup: true,
@@ -288,19 +288,10 @@ const EmptyResultsBox = new Lang.Class({
}
if (this._mode == WindowMode.WindowMode.COLLECTIONS) {
- let label;
- if (Application.application.isBooks)
- label = _("You can create collections from the Books view");
- else
- label = _("You can create collections from the Documents view");
-
- this.add(new Gtk.Label({ label: label }));
+ this.add(new Gtk.Label({ label: _("You can create collections from the Documents view") }));
return;
}
- if (Application.application.isBooks)
- return;
-
let documentsPath = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DOCUMENTS);
let detailsStr = _("Documents from your <a href=\"system-settings\">Online Accounts</a> and " +
"<a href=\"file://%s\">Documents folder</a> will appear
here.").format(documentsPath);
@@ -1052,8 +1043,7 @@ var OverviewStack = new Lang.Class({
// now create the actual content widgets
this._documents = new ViewContainer(this, WindowMode.WindowMode.DOCUMENTS);
- let label = Application.application.isBooks ? _('Books') : _("Documents");
- this._stack.add_titled(this._documents, 'documents', label);
+ this._stack.add_titled(this._documents, 'documents', _("Documents"));
this._collections = new ViewContainer(this, WindowMode.WindowMode.COLLECTIONS);
this._stack.add_titled(this._collections, 'collections', _("Collections"));
diff --git a/src/preview.js b/src/preview.js
index 707d6386..dd3766d3 100644
--- a/src/preview.js
+++ b/src/preview.js
@@ -418,11 +418,6 @@ var PreviewToolbar = new Lang.Class({
action_name: 'view.gear-menu' });
this.toolbar.pack_end(menuButton);
- if (this.preview.canFullscreen && Application.application.isBooks) {
- this._addFullscreenButton();
- this._addNightmodeButton();
- }
-
this.updateTitle();
this.toolbar.show_all();
diff --git a/src/query.js b/src/query.js
index 554ce135..d296e718 100644
--- a/src/query.js
+++ b/src/query.js
@@ -49,7 +49,6 @@ var QueryFlags = {
SEARCH: 1 << 3
};
-var LOCAL_BOOKS_COLLECTIONS_IDENTIFIER = 'gb:collection:local:';
var LOCAL_DOCUMENTS_COLLECTIONS_IDENTIFIER = 'gd:collection:local:';
var QueryBuilder = new Lang.Class({
@@ -256,18 +255,11 @@ var QueryBuilder = new Lang.Class({
},
buildCreateCollectionQuery: function(name) {
- let application = Gio.Application.get_default();
- let collectionsIdentifier;
- if (application.isBooks)
- collectionsIdentifier = LOCAL_BOOKS_COLLECTIONS_IDENTIFIER;
- else
- collectionsIdentifier = LOCAL_DOCUMENTS_COLLECTIONS_IDENTIFIER;
-
let time = GdPrivate.iso8601_from_timestamp(GLib.get_real_time() / GLib.USEC_PER_SEC);
let sparql = ('INSERT { _:res a nfo:DataContainer ; a nie:DataObject ; ' +
'nie:contentLastModified \"' + time + '\" ; ' +
'nie:title \"' + name + '\" ; ' +
- 'nao:identifier \"' + collectionsIdentifier + name + '\" }');
+ 'nao:identifier \"' + LOCAL_DOCUMENTS_COLLECTIONS_IDENTIFIER + name + '\" }');
return this._createQuery(sparql);
},
diff --git a/src/search.js b/src/search.js
index f4b3c98f..281bb4cf 100644
--- a/src/search.js
+++ b/src/search.js
@@ -105,9 +105,7 @@ var SearchTypeStock = {
PDF: 'pdf',
PRESENTATIONS: 'presentations',
SPREADSHEETS: 'spreadsheets',
- TEXTDOCS: 'textdocs',
- EBOOKS: 'ebooks',
- COMICS: 'comics'
+ TEXTDOCS: 'textdocs'
};
const SearchTypeManager = new Lang.Class({
@@ -121,45 +119,25 @@ const SearchTypeManager = new Lang.Class({
this.addItem(new SearchType({ id: SearchTypeStock.ALL,
name: _("All") }));
- if (Application.application.isBooks) {
- this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
- name: _("Collections"),
- filter: 'fn:starts-with(nao:identifier(?urn), \"gb:collection\")',
- where: '?urn rdf:type nfo:DataContainer .' }));
- //FIXME we need to remove all the non-Comics PDFs here
- } else {
- this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
- name: _("Collections"),
- filter: 'fn:starts-with(nao:identifier(?urn), \"gd:collection\")',
- where: '?urn rdf:type nfo:DataContainer .' }));
- this.addItem(new SearchType({ id: SearchTypeStock.PDF,
- name: _("PDF Documents"),
- filter: 'fn:contains(nie:mimeType(?urn), \"application/pdf\")',
- where: '?urn rdf:type nfo:PaginatedTextDocument .' }));
- }
-
- if (Application.application.isBooks) {
- this.addItem(new SearchType({ id: SearchTypeStock.EBOOKS,
- name: _("e-Books"),
- filter: '(nie:mimeType(?urn) IN (\"application/epub+zip\",
\"application/x-mobipocket-ebook\", \"application/x-fictionbook+xml\", \"application/x-zip-compressed-fb2\",
\"image/vnd.djvu+multipage\"))',
- where: '?urn rdf:type nfo:EBook .' }));
- this.addItem(new SearchType({ id: SearchTypeStock.COMICS,
- name: _("Comics"),
- filter: '(nie:mimeType(?urn) IN (\"application/x-cbr\",
\"application/x-cbz\", \"application/vnd.comicbook+zip\", \"application/x-cbt\", \"application/x-cb7\"))',
- where: '?urn rdf:type nfo:EBook .' }));
- } else {
- this.addItem(new SearchType({ id: SearchTypeStock.PRESENTATIONS,
- name: _("Presentations"),
- where: '?urn rdf:type nfo:Presentation .' }));
- this.addItem(new SearchType({ id: SearchTypeStock.SPREADSHEETS,
- name: _("Spreadsheets"),
- where: '?urn rdf:type nfo:Spreadsheet .' }));
- this.addItem(new SearchType({ id: SearchTypeStock.TEXTDOCS,
- name: _("Text Documents"),
- filter: 'NOT EXISTS { ?urn a nfo:EBook }',
- where: '?urn rdf:type nfo:PaginatedTextDocument .' }));
- }
-
+ this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
+ name: _("Collections"),
+ filter: 'fn:starts-with(nao:identifier(?urn), \"gd:collection\")',
+ where: '?urn rdf:type nfo:DataContainer .' }));
+ this.addItem(new SearchType({ id: SearchTypeStock.PDF,
+ name: _("PDF Documents"),
+ filter: 'fn:contains(nie:mimeType(?urn), \"application/pdf\")',
+ where: '?urn rdf:type nfo:PaginatedTextDocument .' }));
+
+ this.addItem(new SearchType({ id: SearchTypeStock.PRESENTATIONS,
+ name: _("Presentations"),
+ where: '?urn rdf:type nfo:Presentation .' }));
+ this.addItem(new SearchType({ id: SearchTypeStock.SPREADSHEETS,
+ name: _("Spreadsheets"),
+ where: '?urn rdf:type nfo:Spreadsheet .' }));
+ this.addItem(new SearchType({ id: SearchTypeStock.TEXTDOCS,
+ name: _("Text Documents"),
+ filter: 'NOT EXISTS { ?urn a nfo:EBook }',
+ where: '?urn rdf:type nfo:PaginatedTextDocument .' }));
this.setActiveItemById(SearchTypeStock.ALL);
},
@@ -176,15 +154,10 @@ const SearchTypeManager = new Lang.Class({
getDocumentTypes: function() {
let types = [];
- if (Application.application.isBooks) {
- types.push(this.getItemById(SearchTypeStock.EBOOKS));
- types.push(this.getItemById(SearchTypeStock.COMICS));
- } else {
- types.push(this.getItemById(SearchTypeStock.PDF));
- types.push(this.getItemById(SearchTypeStock.PRESENTATIONS));
- types.push(this.getItemById(SearchTypeStock.SPREADSHEETS));
- types.push(this.getItemById(SearchTypeStock.TEXTDOCS));
- }
+ types.push(this.getItemById(SearchTypeStock.PDF));
+ types.push(this.getItemById(SearchTypeStock.PRESENTATIONS));
+ types.push(this.getItemById(SearchTypeStock.SPREADSHEETS));
+ types.push(this.getItemById(SearchTypeStock.TEXTDOCS));
return types;
},
@@ -412,10 +385,7 @@ const Source = new Lang.Class({
filters.push('(fn:contains (nie:url(?urn), "%s"))'.format(location.get_uri()));
}));
- if (Application.application.isBooks)
- filters.push('(fn:starts-with (nao:identifier(?urn), "gb:collection:local:"))');
- else
- filters.push('(fn:starts-with (nao:identifier(?urn), "gd:collection:local:"))');
+ filters.push('(fn:starts-with (nao:identifier(?urn), "gd:collection:local:"))');
return '(' + filters.join(' || ') + ')';
},
@@ -464,13 +434,11 @@ const SourceManager = new Lang.Class({
builtin: true });
this.addItem(source);
- if (!Application.application.isBooks) {
- Application.goaClient.connect('account-added', Lang.bind(this, this._refreshGoaAccounts));
- Application.goaClient.connect('account-changed', Lang.bind(this, this._refreshGoaAccounts));
- Application.goaClient.connect('account-removed', Lang.bind(this, this._refreshGoaAccounts));
+ Application.goaClient.connect('account-added', Lang.bind(this, this._refreshGoaAccounts));
+ Application.goaClient.connect('account-changed', Lang.bind(this, this._refreshGoaAccounts));
+ Application.goaClient.connect('account-removed', Lang.bind(this, this._refreshGoaAccounts));
- this._refreshGoaAccounts();
- }
+ this._refreshGoaAccounts();
this.setActiveItemById(SearchSourceStock.ALL);
},
diff --git a/src/selections.js b/src/selections.js
index bf45d23b..98f2d961 100644
--- a/src/selections.js
+++ b/src/selections.js
@@ -154,13 +154,6 @@ const FetchCollectionStateForSelectionJob = new Lang.Class({
hidden = true;
}
- let application = Gio.Application.get_default();
- let collectionsIdentifier;
- if (application.isBooks)
- collectionsIdentifier = Query.LOCAL_BOOKS_COLLECTIONS_IDENTIFIER;
- else
- collectionsIdentifier = Query.LOCAL_DOCUMENTS_COLLECTIONS_IDENTIFIER;
-
for (let itemIdx in this._collectionsForItems) {
let item = Application.documentManager.getItemById(itemIdx);
let collectionsForItem = this._collectionsForItems[itemIdx];
@@ -172,7 +165,7 @@ const FetchCollectionStateForSelectionJob = new Lang.Class({
notFound = true;
if ((item.resourceUrn != collection.resourceUrn) &&
- (collection.identifier.indexOf(collectionsIdentifier) == -1)) {
+ (collection.identifier.indexOf(Query.LOCAL_DOCUMENTS_COLLECTIONS_IDENTIFIER) == -1)) {
hidden = true;
}
}
@@ -870,10 +863,9 @@ var SelectionToolbar = new Lang.Class({
this._toolbarPrint.connect('clicked', Lang.bind(this, this._onToolbarPrint));
this._toolbarTrash.connect('clicked', Lang.bind(this, this._onToolbarTrash));
- if (!Application.application.isBooks) {
- this._toolbarShare.connect('clicked', Lang.bind(this, this._onToolbarShare));
- this._toolbarShare.show();
- }
+ this._toolbarShare.connect('clicked', Lang.bind(this, this._onToolbarShare));
+ this._toolbarShare.show();
+
this._toolbarProperties.connect('clicked', Lang.bind(this, this._onToolbarProperties));
this._toolbarCollection.connect('clicked', Lang.bind(this, this._onToolbarCollection));
@@ -995,8 +987,7 @@ var SelectionToolbar = new Lang.Class({
this._toolbarProperties.set_sensitive(showProperties);
this._toolbarTrash.set_sensitive(showTrash);
this._toolbarOpen.set_sensitive(showOpen);
- if (!Application.application.isBooks)
- this._toolbarShare.set_sensitive(showShare);
+ this._toolbarShare.set_sensitive(showShare);
this._toolbarCollection.set_sensitive(showCollection);
this._insideRefresh = false;
diff --git a/src/windowMode.js b/src/windowMode.js
index 0bb96902..9797528f 100644
--- a/src/windowMode.js
+++ b/src/windowMode.js
@@ -27,10 +27,9 @@ var WindowMode = {
DOCUMENTS: 1,
PREVIEW_EV: 2,
PREVIEW_LOK: 3,
- PREVIEW_EPUB: 4,
- EDIT: 5,
- COLLECTIONS: 6,
- SEARCH: 7,
+ EDIT: 4,
+ COLLECTIONS: 5,
+ SEARCH: 6,
};
var ModeController = new Lang.Class({
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]