Revision 1781 trunk/client/gui_qt/WidgetDownloadQueue.cpp

WidgetDownloadQueue.cpp (revision 1781)
5 5

                
6 6
#include "WidgetDownloadQueue.h"
7 7
#include "ui_WidgetDownloadQueue.h"
8
#include "DownloadQueueSelectionModel.h"
8 9

                
9 10
#include "nntpgrab_utils.h"
10 11

                
... ...
31 32
    connect(ui->btnQueueMoveDown, SIGNAL(clicked(void)), SLOT(btnQueueMoveDown_clicked(void)));
32 33
    connect(ui->btnQueueMoveToBottom, SIGNAL(clicked(void)), SLOT(btnQueueMoveToBottom_clicked(void)));
33 34

                
34
    QItemSelectionModel *selectionModel = ui->treeView->selectionModel();
35
    DownloadQueueSelectionModel *selectionModel = new DownloadQueueSelectionModel(this->model);
36
    ui->treeView->setSelectionModel(selectionModel);
35 37
    connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), SLOT(onSelectionChanged(const QItemSelection &, const QItemSelection &)));
36 38

                
37 39
    connect(ui->actionMarkItemOptional, SIGNAL(triggered()), SLOT(actionMarkItemOptional_activated()));
... ...
143 145

                
144 146
        for (int j = 0; j < collection_item->childCount(); j++) {
145 147
            subject_item = collection_item->child(j);
146
            QModelIndex idx_subject = model->index(i, 0, idx_collection);
148
            QModelIndex idx_subject = model->index(subject_item->row(), 0, idx_collection);
147 149

                
148 150
            if (selectionModel->isSelected(idx_subject)) {
149 151
                if (j == collection_item->childCount() - 1 && direction == MOVE_DIRECTION_DOWN) {

Also available in: Unified diff