[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [nepomuk-core/KDE/4.11] services/fileindexer/indexer: epubextractor: publication date inside a longe
From:       Simeon Bird <bladud () gmail ! com>
Date:       2013-08-27 22:37:07
Message-ID: E1VERsp-0007ZM-LJ () scm ! kde ! org
[Download RAW message or body]

Git commit f546c05f42af1f4c150356827ea7279947b4e8fb by Simeon Bird.
Committed on 27/08/2013 at 22:31.
Pushed by sbird into branch 'KDE/4.11'.

epubextractor: publication date inside a longer string

Bug 323811 had a file where the EPUB_DATE string was:
"creation: 2011-02-22;publication: 1999"
This checks for such strings and cuts them to "1999".

M  +3    -2    services/fileindexer/indexer/epubextractor.cpp

http://commits.kde.org/nepomuk-core/f546c05f42af1f4c150356827ea7279947b4e8fb

diff --git a/services/fileindexer/indexer/epubextractor.cpp \
b/services/fileindexer/indexer/epubextractor.cpp index fed3822..38fb0d8 100644
--- a/services/fileindexer/indexer/epubextractor.cpp
+++ b/services/fileindexer/indexer/epubextractor.cpp
@@ -148,8 +148,9 @@ SimpleResourceGraph EPubExtractor::extract(const QUrl& resUri, \
const QUrl& fileU  if( value.startsWith("Unspecified:", Qt::CaseInsensitive) ) {
             value = value.mid( QString("Unspecified:").size() ).simplified();
         }
-        if( value.startsWith("publication:", Qt::CaseInsensitive) ) {
-            value = value.mid( QString("publication:").size() ).simplified();
+        int ind = value.indexOf("publication:", Qt::CaseInsensitive);
+        if( ind != -1) {
+            value = value.mid( ind + QString("publication:").size() ).simplified();
         }
         QDateTime dt = ExtractorPlugin::dateTimeFromString(value);
         if( !dt.isNull() )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic