Fix forward navigation control on Linux.
[dorian] / chaptersdialog.cpp
index 1aaffd3..20f7824 100644 (file)
@@ -1,13 +1,12 @@
-#include <QtGui>
+#include <QStringListModel>
 
 #include "chaptersdialog.h"
 #include "book.h"
-#include "listview.h"
 
-ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent)
+ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent):
+        ListWindow(tr("(No chapters)"), parent)
 {
     setWindowTitle(tr("Chapters"));
-
     if (book) {
         foreach (QString id, book->chapters) {
             QString contentTitle = book->content[id].name;
@@ -15,18 +14,9 @@ ChaptersDialog::ChaptersDialog(Book *book, QWidget *parent): ListWindow(parent)
         }
     }
     QStringListModel *model = new QStringListModel(data, this);
-    list = new ListView;
-    list->setSelectionMode(QAbstractItemView::SingleSelection);
-    list->setModel(model);
-    list->setUniformItemSizes(true);
-    addList(list);
-    connect(list, SIGNAL(activated(const QModelIndex &)),
+    setModel(model);
+    connect(this, SIGNAL(activated(const QModelIndex &)),
             this, SLOT(onItemActivated(const QModelIndex &)));
-
-#ifndef Q_WS_MAEMO_5
-    addAction(tr("Close"), this, SLOT(close()), QString(),
-              QDialogButtonBox::RejectRole);
-#endif // Q_WS_MAEMO_5
 }
 
 void ChaptersDialog::onItemActivated(const QModelIndex &index)