#include <QDir>
#include <QFile>
-#include "listview.h"
#include "searchresultsdialog.h"
#include "searchresultinfodialog.h"
#include "trace.h"
#include "platform.h"
SearchResultsDialog::SearchResultsDialog(const QList<Search::Result> results_,
- QWidget *parent): ListWindow(parent), results(results_)
+ QWidget *parent): ListWindow(tr("(No results)"), parent), results(results_)
{
setWindowTitle(tr("Search results"));
QStringListModel *model = new QStringListModel(data, this);
setModel(model);
- // FIXME
- // connect(list, SIGNAL(activated(const QModelIndex &)),
- // this, SLOT(onItemActivated(const QModelIndex &)));
+ connect(this, SIGNAL(activated(const QModelIndex &)),
+ this, SLOT(onItemActivated(const QModelIndex &)));
Search *search = Search::instance();
connect(search, SIGNAL(beginDownload(int)), this, SLOT(onBeginDownload(int)));
connect(search,
Library::instance()->add(fileName);
int row = results.indexOf(result);
if (-1 != row) {
- list->model()->removeRow(row);
+ results.removeAt(row);
+ model()->removeRow(row);
}
- Platform::instance()->information(tr("Downloaded \"%1\"\nand added to the "
- "library").arg(result.title), this);
+ Platform::instance()->
+ information(tr("Downloaded \"%1\"\nand added to the "
+ "library").arg(result.title), this);
}
}