Fix author name in library and book info dialogs.
authorU-NOE\polster <polster@4DKD01593.NOE.Nokia.com>
Mon, 6 Dec 2010 13:54:13 +0000 (14:54 +0100)
committerU-NOE\polster <polster@4DKD01593.NOE.Nokia.com>
Mon, 6 Dec 2010 13:54:13 +0000 (14:54 +0100)
infodialog.cpp
librarydialog.cpp
model/book.cpp
model/opshandler.h
model/sortedlibrary.cpp
pkg/changelog

index a9861c7..621eaaa 100644 (file)
@@ -24,11 +24,7 @@ InfoDialog::InfoDialog(Book *b, QWidget *parent, bool showButtons):
         if (book->creators.size()) {
             QLabel *creators = new QLabel(this);
             creators->setWordWrap(true);
-            QString c = "By " + book->creators[0];
-            for (int i = 1; i < book->creators.size(); i++) {
-                c += ", " + book->creators[i];
-            }
-            creators->setText(c);
+            creators->setText(book->creators.join(", "));
             addWidget(creators);
         }
         QLabel *path = new QLabel("File: " + book->path(), this);
index e45fe8f..cf48c48 100644 (file)
 #include "progressdialog.h"
 #include "settings.h"
 
-LibraryDialog::LibraryDialog(QWidget *parent): ListWindow(tr("(No books)"), parent)
+LibraryDialog::LibraryDialog(QWidget *parent):
+        ListWindow(tr("(No books)"), parent)
 {
     TRACE;
     setWindowTitle(tr("Library"));
     setAttribute(Qt::WA_DeleteOnClose, true);
 
     // Add menu actions
-    sortByTitle = addMenuAction(tr("Sort by title"), this, SLOT(onSortByTitle()));
+    sortByTitle =
+            addMenuAction(tr("Sort by title"), this, SLOT(onSortByTitle()));
     sortByAuthor =
             addMenuAction(tr("Sort by author"), this, SLOT(onSortByAuthor()));
 
index 89490d2..874ff2b 100644 (file)
@@ -404,10 +404,7 @@ QString Book::name()
     if (title.size()) {
         QString ret = title;
         if (creators.length()) {
-            ret += "\nBy " + creators[0];
-            for (int i = 1; i < creators.length(); i++) {
-                ret += ", " + creators[i];
-            }
+            ret += "\nBy " + creators.join(", ");
         }
         return ret;
     }
index f764860..1d961c8 100644 (file)
@@ -9,7 +9,9 @@
 class OpsHandler: public XmlHandler
 {
 public:
-    OpsHandler(Book &b): book(b), partCount(0) {}
+    OpsHandler(Book &b): book(b), partCount(0) {
+        book.creators.clear();
+    }
 
     bool endElement(const QString &namespaceUri, const QString &name,
                     const QString &qName) {
index 241dfe7..e1efd19 100644 (file)
@@ -59,6 +59,7 @@ int SortedLibrary::compareBy(SortBy key, Book *left, Book *right) const
         return QString::localeAwareCompare(left->creators.join(" "),
                                            right->creators.join(" "));
     default:
-        return QString::localeAwareCompare(left->shortName(), right->shortName());
+        return QString::localeAwareCompare(left->shortName(),
+                                           right->shortName());
     }
 }
index ee7da99..452c95d 100644 (file)
@@ -2,6 +2,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
 
  -- Akos Polster <akos@pipacs.com>  Sun,  5 Dec 2010 02:00:00 +0100