From: U-NOE\polster Date: Mon, 6 Dec 2010 13:54:13 +0000 (+0100) Subject: Fix author name in library and book info dialogs. X-Git-Url: http://vcs.maemo.org/git/?p=dorian;a=commitdiff_plain;h=c88b9707625d40c905e88c8099499981c77ec807 Fix author name in library and book info dialogs. --- diff --git a/infodialog.cpp b/infodialog.cpp index a9861c7..621eaaa 100644 --- a/infodialog.cpp +++ b/infodialog.cpp @@ -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); diff --git a/librarydialog.cpp b/librarydialog.cpp index e45fe8f..cf48c48 100644 --- a/librarydialog.cpp +++ b/librarydialog.cpp @@ -16,14 +16,16 @@ #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())); diff --git a/model/book.cpp b/model/book.cpp index 89490d2..874ff2b 100644 --- a/model/book.cpp +++ b/model/book.cpp @@ -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; } diff --git a/model/opshandler.h b/model/opshandler.h index f764860..1d961c8 100644 --- a/model/opshandler.h +++ b/model/opshandler.h @@ -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) { diff --git a/model/sortedlibrary.cpp b/model/sortedlibrary.cpp index 241dfe7..e1efd19 100644 --- a/model/sortedlibrary.cpp +++ b/model/sortedlibrary.cpp @@ -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()); } } diff --git a/pkg/changelog b/pkg/changelog index ee7da99..452c95d 100644 --- a/pkg/changelog +++ b/pkg/changelog @@ -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 Sun, 5 Dec 2010 02:00:00 +0100