From 04c7ab118a52f222ddb48b9af87a1cc46e26ef55 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 12 Apr 2015 11:08:13 -0400 Subject: [PATCH] Updates for 0.8.6 --- CMakeLists.txt | 2 +- ChangeLog.txt | 8 ++++++++ src/Sigil/BookManipulation/Book.cpp | 3 +++ src/Sigil/BookManipulation/CleanSource.cpp | 8 +++++++- src/Sigil/BookManipulation/FolderKeeper.cpp | 4 ++-- src/Sigil/ResourceObjects/OPFResource.cpp | 8 ++++++++ src/Sigil/Tabs/FlowTab.cpp | 8 +------- src/Sigil/ViewEditors/BookViewPreview.cpp | 2 ++ version.xml | 2 +- 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b15c983e6..9523264c4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_e set( SIGIL_MAJOR_VERSION 0 ) set( SIGIL_MINOR_VERSION 8 ) -set( SIGIL_REVISION_VERSION 5 ) +set( SIGIL_REVISION_VERSION 6 ) set( SIGIL_FULL_VERSION ${SIGIL_MAJOR_VERSION}.${SIGIL_MINOR_VERSION}.${SIGIL_REVISION_VERSION} ) # Apple users building with XCode notes: diff --git a/ChangeLog.txt b/ChangeLog.txt index 0f1c452214..5d47aea3cf 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +Sigil 0.8.6 2015.04.12 + - Fix for crash during merging xhtml files. + - Changed fix for "Create TOC crash in Sigil 0.8.5" to reduce the degree + of disconnecting to prevent lost signals on html resources. + - Fix for missing audio and video mime types in OPFResource and + FolderKeeper. + - Attempt to prevent Tidy from simply deleting all mathml during cleaning. + Sigil 0.8.5 2015.03.29 - Fix text resource not alwalys saving to disk. - Fix bug in missing CSS. diff --git a/src/Sigil/BookManipulation/Book.cpp b/src/Sigil/BookManipulation/Book.cpp index d2be32ef90..2fe78f81cf 100644 --- a/src/Sigil/BookManipulation/Book.cpp +++ b/src/Sigil/BookManipulation/Book.cpp @@ -925,6 +925,9 @@ Resource *Book::MergeResources(QList resources) sink_html_resource.SetText(XhtmlDoc::GetDomDocumentAsString(sink_dom)); // Now safe to do the delete foreach(Resource * source_resource, resources) { + // Need to alert FolderKeeper that these are going away to properly update its + // m_Resources hash to prevent stale values from deleted resources hanging around + m_Mainfolder.RemoveResource(*source_resource); source_resource->Delete(); } } diff --git a/src/Sigil/BookManipulation/CleanSource.cpp b/src/Sigil/BookManipulation/CleanSource.cpp index b3c80b5a85..5f8c090fc6 100644 --- a/src/Sigil/BookManipulation/CleanSource.cpp +++ b/src/Sigil/BookManipulation/CleanSource.cpp @@ -83,9 +83,15 @@ static QString HTML5_BLOCK_ELEMENTS = "article,aside,audio,canvas,datagrid static QString HTML5_INLINE_ELEMENTS = "command,mark,meter,progress,rp,rt,ruby,time"; static QString HTML5_EMPTY_ELEMENTS = ""; +static QString MATHML_INLINE_ELEMENTS = "math,maction,maligngroup,malignmark,menclose,merror,mfenced" + ",mfrac,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mroot" + ",mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msup,msubsup" + ",mtable,mtd,mtext,mtr,munder,munderover,semantics,annotation,annotation-xml"; + + // Don't mix inline with block but inline can be duplicated with empty according to tidy docs static QString BLOCK_ELEMENTS = HTML5_BLOCK_ELEMENTS + "," + SVG_BLOCK_ELEMENTS; -static QString INLINE_ELEMENTS = HTML5_INLINE_ELEMENTS + "," + SVG_INLINE_ELEMENTS;; +static QString INLINE_ELEMENTS = HTML5_INLINE_ELEMENTS + "," + SVG_INLINE_ELEMENTS + "," + MATHML_INLINE_ELEMENTS; static QString EMPTY_ELEMENTS = HTML5_EMPTY_ELEMENTS + "," + SVG_EMPTY_ELEMENTS; // Performs general cleaning (and improving) diff --git a/src/Sigil/BookManipulation/FolderKeeper.cpp b/src/Sigil/BookManipulation/FolderKeeper.cpp index 9faf5b3e43..ad3e16bde9 100644 --- a/src/Sigil/BookManipulation/FolderKeeper.cpp +++ b/src/Sigil/BookManipulation/FolderKeeper.cpp @@ -57,8 +57,8 @@ const QStringList MISC_TEXT_EXTENSIONS = QStringList() << "txt" << "js" << "xp const QStringList FONT_EXTENSIONS = QStringList() << "ttf" << "ttc" << "otf"; const QStringList TEXT_EXTENSIONS = QStringList() << "xhtml" << "html" << "htm" << "xml"; const QStringList STYLE_EXTENSIONS = QStringList() << "css"; -const QStringList AUDIO_EXTENSIONS = QStringList() << "aac" << "m4a" << "mp3" << "mpeg" << "mpg"; -const QStringList VIDEO_EXTENSIONS = QStringList() << "m4v" << "mp4" << "mov" << "ogg" << "webm"; +const QStringList AUDIO_EXTENSIONS = QStringList() << "aac" << "m4a" << "mp3" << "mpeg" << "mpg" << "oga" << "ogg"; +const QStringList VIDEO_EXTENSIONS = QStringList() << "m4v" << "mp4" << "mov" << "ogv" << "webm"; const QString IMAGE_FOLDER_NAME = "Images"; const QString FONT_FOLDER_NAME = "Fonts"; diff --git a/src/Sigil/ResourceObjects/OPFResource.cpp b/src/Sigil/ResourceObjects/OPFResource.cpp index 51f596d114..74278b04bb 100644 --- a/src/Sigil/ResourceObjects/OPFResource.cpp +++ b/src/Sigil/ResourceObjects/OPFResource.cpp @@ -1482,11 +1482,19 @@ void OPFResource::CreateMimetypes() m_Mimetypes[ "html" ] = "application/xhtml+xml"; m_Mimetypes[ "htm" ] = "application/xhtml+xml"; m_Mimetypes[ "css" ] = "text/css"; + // Multimedia files + m_Mimetypes[ "mp3" ] = "audio/mpeg"; + m_Mimetypes[ "oga" ] = "audio/ogg"; + m_Mimetypes[ "ogg" ] = "audio/ogg"; + m_Mimetypes[ "mp4" ] = "video/mp4"; + m_Mimetypes[ "ogv" ] = "video/ogg"; + m_Mimetypes[ "webm" ] = "video/webm"; // Until the standards gods grace us with font mimetypes, // these will have to do m_Mimetypes[ "otf" ] = "application/vnd.ms-opentype"; m_Mimetypes[ "ttf" ] = "application/x-font-ttf"; m_Mimetypes[ "ttc" ] = "application/x-font-truetype-collection"; + m_Mimetypes[ "woff" ] = "application/font-woff"; } diff --git a/src/Sigil/Tabs/FlowTab.cpp b/src/Sigil/Tabs/FlowTab.cpp index 3511a30909..c67065bd9b 100644 --- a/src/Sigil/Tabs/FlowTab.cpp +++ b/src/Sigil/Tabs/FlowTab.cpp @@ -109,14 +109,8 @@ FlowTab::~FlowTab() // Explicitly disconnect signals because Modified is causing the ResourceModified // function to be called after we delete BV and PV later in this destructor. // No idea how that's possible but this prevents a segfault... - disconnect(&m_HTMLResource, 0, 0, 0); + disconnect(&m_HTMLResource, SIGNAL(Modified()), this, SLOT(ResourceModified())); disconnect(this, 0, 0, 0); - if (m_wBookView) { - disconnect(m_wBookView, 0, 0, 0); - } - if (m_wCodeView) { - disconnect(m_wCodeView, 0, 0, 0); - } m_WellFormedCheckComponent.deleteLater(); if (m_wBookView) { diff --git a/src/Sigil/ViewEditors/BookViewPreview.cpp b/src/Sigil/ViewEditors/BookViewPreview.cpp index 5aba9ee8ec..48fe82ffb3 100644 --- a/src/Sigil/ViewEditors/BookViewPreview.cpp +++ b/src/Sigil/ViewEditors/BookViewPreview.cpp @@ -72,6 +72,8 @@ BookViewPreview::BookViewPreview(QWidget *parent) // Enable our link filter. page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + // This should not be needed on Windows if we simply include the correct qt plugins + // page()->settings()->setAttribute(QWebSettings::PluginsEnabled, true); CreateContextMenuActions(); ConnectSignalsToSlots(); } diff --git a/version.xml b/version.xml index 435870c023..8cf4ce4bd8 100644 --- a/version.xml +++ b/version.xml @@ -1,4 +1,4 @@  - 0.8.4 + 0.8.6