X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=searchresultsdialog.cpp;h=15d69772be0819cc1526431e7e30e61dc7fbda6d;hb=b72c0798bfde194a8f87ecd15956bbe99b184db8;hp=940c438684bfe50d09da0dbf0c8da6d3bb354a12;hpb=678671f16bae6bf6276d9a56bf9f4bd17119c239;p=dorian diff --git a/searchresultsdialog.cpp b/searchresultsdialog.cpp index 940c438..15d6977 100644 --- a/searchresultsdialog.cpp +++ b/searchresultsdialog.cpp @@ -5,7 +5,6 @@ #include #include -#include "listview.h" #include "searchresultsdialog.h" #include "searchresultinfodialog.h" #include "trace.h" @@ -14,7 +13,7 @@ #include "platform.h" SearchResultsDialog::SearchResultsDialog(const QList results_, - QWidget *parent): ListWindow(parent), results(results_) + QWidget *parent): ListWindow(tr("(No results)"), parent), results(results_) { setWindowTitle(tr("Search results")); @@ -27,13 +26,8 @@ SearchResultsDialog::SearchResultsDialog(const QList results_, } QStringListModel *model = new QStringListModel(data, this); - list = new ListView; - list->setSelectionMode(QAbstractItemView::SingleSelection); - list->setModel(model); - list->setUniformItemSizes(true); - addList(list); - addItemAction(tr("Download book"), this, SLOT(onDownload())); - connect(list, SIGNAL(activated(const QModelIndex &)), + setModel(model); + connect(this, SIGNAL(activated(const QModelIndex &)), this, SLOT(onItemActivated(const QModelIndex &))); Search *search = Search::instance(); connect(search, SIGNAL(beginDownload(int)), this, SLOT(onBeginDownload(int))); @@ -61,11 +55,6 @@ void SearchResultsDialog::onItemActivated(const QModelIndex &index) } } -void SearchResultsDialog::onDownload() -{ - onItemActivated(list->currentIndex()); -} - QString SearchResultsDialog::downloadName() const { TRACE; @@ -100,7 +89,7 @@ void SearchResultsDialog::onEndDownload(int status, const Search::Result &result Library::instance()->add(fileName); int row = results.indexOf(result); if (-1 != row) { - list->model()->removeRow(row); + model()->removeRow(row); } Platform::instance()->information(tr("Downloaded \"%1\"\nand added to the " "library").arg(result.title), this);