Improve identification if bookmark's chapter. Add some AppAward
authorAkos Polster <polster@marzipan.local>
Mon, 20 Dec 2010 12:22:18 +0000 (13:22 +0100)
committerAkos Polster <polster@marzipan.local>
Mon, 20 Dec 2010 12:22:18 +0000 (13:22 +0100)
paperwork.

doc/AppAward-MetadataTemplate.xlsx
doc/dorian-256.png [new file with mode: 0644]
model/book.cpp
model/ncxhandler.h
pkg/changelog

index 75fca70..e9689a9 100644 (file)
Binary files a/doc/AppAward-MetadataTemplate.xlsx and b/doc/AppAward-MetadataTemplate.xlsx differ
diff --git a/doc/dorian-256.png b/doc/dorian-256.png
new file mode 100644 (file)
index 0000000..57c2fc4
Binary files /dev/null and b/doc/dorian-256.png differ
index 874ff2b..d209816 100644 (file)
@@ -435,18 +435,17 @@ int Book::chapterFromPart(int index)
     for (int i = 0; i < chapters.size(); i++) {
         QString id = chapters[i];
         QString href = content[id].href;
-        QString baseRef(href);
-        QUrl url(QString("file://") + href);
-        if (url.hasFragment()) {
-            QString fragment = url.fragment();
-            baseRef.chop(fragment.length() + 1);
+        int hashPos = href.indexOf("#");
+        if (hashPos != -1) {
+            href = href.left(hashPos);
         }
-        if (baseRef == partHref) {
+        if (href == partHref) {
             ret = i;
             // Don't break, keep looking
         }
     }
 
+    qDebug() << "Part" << index << partId << partHref << ":" << ret;
     return ret;
 }
 
index 6121992..05a66e1 100644 (file)
@@ -29,6 +29,8 @@ public:
             contentItem.size = 0;
             book.content[id] = contentItem;
             book.chapters.append(id);
+            qDebug() << "TreeItem::addToBook" << id << contentItem.href
+                    << contentItem.name;
             foreach (TreeItem *child, children) {
                 child->addToBook(book);
             }
index 452c95d..cba3923 100644 (file)
@@ -3,6 +3,7 @@ dorian (0.4.4-1) unstable; urgency=low
   * Have an overlap between current/next page
   * Add tool bars to list windows on Symbian
   * Fix author name in libary and book info
+  * Improve identification of bookmark's chapter
 
  -- Akos Polster <akos@pipacs.com>  Sun,  5 Dec 2010 02:00:00 +0100