mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 15:14:28 +08:00
change torrentDoubleClicked() so it can be used in a hotkey
This commit is contained in:
parent
077ad6506c
commit
ed900d3e86
@ -147,7 +147,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window)
|
|||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
|
|
||||||
// Listen for list events
|
// Listen for list events
|
||||||
connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked(QModelIndex)));
|
connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked()));
|
||||||
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(displayListMenu(const QPoint &)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(displayListMenu(const QPoint &)));
|
||||||
header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
header()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(displayDLHoSMenu(const QPoint &)));
|
connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(displayDLHoSMenu(const QPoint &)));
|
||||||
@ -208,9 +208,14 @@ inline QModelIndex TransferListWidget::mapFromSource(const QModelIndex &index) c
|
|||||||
return nameFilterModel->mapFromSource(index);
|
return nameFilterModel->mapFromSource(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListWidget::torrentDoubleClicked(const QModelIndex& index)
|
void TransferListWidget::torrentDoubleClicked()
|
||||||
{
|
{
|
||||||
BitTorrent::TorrentHandle *const torrent = listModel->torrentHandle(mapToSource(index));
|
const QModelIndexList selectedIndexes = selectionModel()->selectedRows();
|
||||||
|
if (selectedIndexes.size() != 1) return;
|
||||||
|
if (!selectedIndexes.first().isValid()) return;
|
||||||
|
|
||||||
|
const QModelIndex index = listModel->index(mapToSource(selectedIndexes.first()).row());
|
||||||
|
BitTorrent::TorrentHandle *const torrent = listModel->torrentHandle(index);
|
||||||
if (!torrent) return;
|
if (!torrent) return;
|
||||||
|
|
||||||
int action;
|
int action;
|
||||||
|
@ -101,7 +101,7 @@ protected:
|
|||||||
QList<BitTorrent::TorrentHandle *> getSelectedTorrents() const;
|
QList<BitTorrent::TorrentHandle *> getSelectedTorrents() const;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void torrentDoubleClicked(const QModelIndex& index);
|
void torrentDoubleClicked();
|
||||||
void displayListMenu(const QPoint&);
|
void displayListMenu(const QPoint&);
|
||||||
void currentChanged(const QModelIndex& current, const QModelIndex&);
|
void currentChanged(const QModelIndex& current, const QModelIndex&);
|
||||||
void toggleSelectedTorrentsSuperSeeding() const;
|
void toggleSelectedTorrentsSuperSeeding() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user