Git commit 1cc63e5bedb2550268cb47c5cbc29d61c3f29718 by Robby Stephenson. Committed on 23/04/2017 at 22:25. Pushed by rstephenson into branch 'master'.
Add default Plot field to books and comic books M +6 -4 doc/details.docbook M +3 -1 src/collections/bookcollection.cpp M +3 -1 src/collections/comicbookcollection.cpp M +0 -5 src/fetch/doubanfetcher.cpp M +1 -4 src/fetch/ibsfetcher.cpp M +0 -2 xslt/dbc2tellico.xsl M +0 -1 xslt/gcstar2tellico.xsl https://commits.kde.org/tellico/1cc63e5bedb2550268cb47c5cbc29d61c3f29718 diff --git a/doc/details.docbook b/doc/details.docbook index 299e8116..6d5fb201 100644 --- a/doc/details.docbook +++ b/doc/details.docbook @@ -207,7 +207,7 @@ By default, all the collection types include an <emphasis>ID</emphasis> field, w <sect2 id="book-collection"> <title>Book Collections</title> <para> -Book collections have 26 default fields: +Book collections have 27 default fields: <emphasis>Title</emphasis>, <emphasis>Subtitle</emphasis>, <emphasis>Author</emphasis>, @@ -232,7 +232,8 @@ Book collections have 26 default fields: <emphasis>Gift</emphasis>, <emphasis>Loaned</emphasis>, <emphasis>Rating</emphasis>, -<emphasis>Front Cover</emphasis>, and +<emphasis>Front Cover</emphasis>, +<emphasis>Plot Summary</emphasis>, and <emphasis>Comments</emphasis>. </para> @@ -289,7 +290,7 @@ Book collections can be converted to bibliographies. Default bibtex fields are a <sect2 id="comic-book-collection"> <title>Comic Book Collections</title> <para> -Comic book collections have 22 default fields: +Comic book collections have 23 default fields: <emphasis>Title</emphasis>, <emphasis>Subtitle</emphasis>, <emphasis>Writer</emphasis>, @@ -310,7 +311,8 @@ Comic book collections have 22 default fields: <emphasis>Signed</emphasis>, <emphasis>Gift</emphasis>, <emphasis>Loaned</emphasis>, -<emphasis>Front Cover</emphasis>, and +<emphasis>Front Cover</emphasis>, +<emphasis>Plot Summary</emphasis>, and <emphasis>Comments</emphasis>. </para> diff --git a/src/collections/bookcollection.cpp b/src/collections/bookcollection.cpp index dd8cd82d..c4b0c486 100644 --- a/src/collections/bookcollection.cpp +++ b/src/collections/bookcollection.cpp @@ -182,8 +182,10 @@ Tellico::Data::FieldList BookCollection::defaultFields() { field = new Field(QLatin1String("cover"), i18n("Front Cover"), Field::Image); list.append(field); + field = new Field(QLatin1String("plot"), i18n("Plot Summary"), Field::Para); + list.append(field); + field = new Field(QLatin1String("comments"), i18n("Comments"), Field::Para); - field->setCategory(i18n(book_personal)); list.append(field); list.append(createDefaultField(IDField)); diff --git a/src/collections/comicbookcollection.cpp b/src/collections/comicbookcollection.cpp index c49e28c1..b704750f 100644 --- a/src/collections/comicbookcollection.cpp +++ b/src/collections/comicbookcollection.cpp @@ -159,8 +159,10 @@ Tellico::Data::FieldList ComicBookCollection::defaultFields() { field = new Field(QLatin1String("cover"), i18n("Front Cover"), Field::Image); list.append(field); + field = new Field(QLatin1String("plot"), i18n("Plot Summary"), Field::Para); + list.append(field); + field = new Field(QLatin1String("comments"), i18n("Comments"), Field::Para); - field->setCategory(i18n(comic_personal)); list.append(field); list.append(createDefaultField(IDField)); diff --git a/src/fetch/doubanfetcher.cpp b/src/fetch/doubanfetcher.cpp index 8c35e096..e5f9fc73 100644 --- a/src/fetch/doubanfetcher.cpp +++ b/src/fetch/doubanfetcher.cpp @@ -323,11 +323,6 @@ Tellico::Data::EntryPtr DoubanFetcher::createEntry(const QVariantMap& resultMap_ f->setCategory(i18n("General")); coll->addField(f); } - // always add a plot field. TODO: Eventually, should make a default field? - if(!coll->hasField(QLatin1String("plot"))) { - Data::FieldPtr f(new Data::Field(QLatin1String("plot"), i18n("Plot Summary"), Data::Field::Para)); - coll->addField(f); - } entry = new Data::Entry(coll); populateBookEntry(entry, resultMap_); break; diff --git a/src/fetch/ibsfetcher.cpp b/src/fetch/ibsfetcher.cpp index 28c7c8fb..b14fb5d8 100644 --- a/src/fetch/ibsfetcher.cpp +++ b/src/fetch/ibsfetcher.cpp @@ -275,10 +275,7 @@ Tellico::Data::EntryPtr IBSFetcher::parseEntry(const QString& str_) { const QString lang = value(resultMap, "inLanguage"); entry->setField(QLatin1String("language"), QLocale(lang.toLower()).nativeLanguageName()); - Data::FieldPtr f(new Data::Field(QLatin1String("plot"), i18n("Plot Summary"), Data::Field::Para)); - coll->addField(f); - entry->setField(f, value(resultMap, "description")); - + entry->setField(QLatin1String("plot"), value(resultMap, "description")); entry->setField(QLatin1String("pages"), value(resultMap, "numberOfPages")); entry->setField(QLatin1String("publisher"), value(resultMap, "publisher")); diff --git a/xslt/dbc2tellico.xsl b/xslt/dbc2tellico.xsl index dff6b624..f9bef65b 100644 --- a/xslt/dbc2tellico.xsl +++ b/xslt/dbc2tellico.xsl @@ -36,8 +36,6 @@ <collection title="DBC Import" type="2"> <fields> <field name="_default"/> - <!-- add a plot field --> - <field flags="0" title="Plot" category="Plot Summary" format="4" type="2" name="plot" i18n="true"/> </fields> <!-- only grab records whose type is Book, "Bog" --> <xsl:apply-templates select="dbc:searchResponse/dbc:result/dbc:searchResult/dbc:collection/dbc:object/dkabm:record[dc:type[@xsi:type='dkdcplus:BibDK-Type']='Bog']"/> diff --git a/xslt/gcstar2tellico.xsl b/xslt/gcstar2tellico.xsl index 0159ce03..f2584999 100644 --- a/xslt/gcstar2tellico.xsl +++ b/xslt/gcstar2tellico.xsl @@ -116,7 +116,6 @@ </xsl:when> <xsl:when test="@type='GCcomics'"> <tc:field flags="0" title="ISBN#" category="Publishing" format="4" description="International Standard Book Number" type="1" name="isbn" i18n="true"/> - <tc:field flags="0" title="Plot" category="Plot" format="4" type="2" name="plot" i18n="true"/> <tc:field flags="7" title="Colorist" category="General" format="2" type="1" name="colorist" i18n="true"/> <tc:field flags="6" title="Format" category="Publishing" format="4" type="1" name="format" i18n="true"/> <tc:field flags="6" title="Category" category="Publishing" format="4" type="1" name="category" i18n="true"/>
