mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Preview from finished list should now be working
This commit is contained in:
parent
8c9ce5dd45
commit
a0743c0713
@ -51,7 +51,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession){
|
|||||||
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
|
||||||
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
|
||||||
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(deleteSelection()));
|
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(deleteSelection()));
|
||||||
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(startSelection()));
|
connect(actionPreview_file, SIGNAL(triggered()), (GUI*)parent, SLOT(previewFileSelection()));
|
||||||
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(deletePermanently()));
|
connect(actionDelete_Permanently, SIGNAL(triggered()), (GUI*)parent, SLOT(deletePermanently()));
|
||||||
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
|
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
|
||||||
}
|
}
|
||||||
|
18
src/GUI.cpp
18
src/GUI.cpp
@ -310,12 +310,24 @@ void GUI::togglePausedState(const QModelIndex& index){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::previewFileSelection(){
|
void GUI::previewFileSelection(){
|
||||||
|
if(tabs->currentIndex() > 1) return;
|
||||||
|
bool inDownloadList = true;
|
||||||
|
if(tabs->currentIndex() != 0)
|
||||||
|
inDownloadList = false;
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
QModelIndexList selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
QModelIndexList selectedIndexes;
|
||||||
|
if(inDownloadList)
|
||||||
|
selectedIndexes = downloadList->selectionModel()->selectedIndexes();
|
||||||
|
else
|
||||||
|
selectedIndexes = finishedTorrentTab->getFinishedList()->selectionModel()->selectedIndexes();
|
||||||
foreach(index, selectedIndexes){
|
foreach(index, selectedIndexes){
|
||||||
if(index.column() == NAME){
|
if(index.column() == NAME){
|
||||||
// Get the file name
|
// Get the file hash
|
||||||
QString fileHash = DLListModel->data(DLListModel->index(index.row(), HASH)).toString();
|
QString fileHash;
|
||||||
|
if(inDownloadList)
|
||||||
|
fileHash = DLListModel->data(DLListModel->index(index.row(), HASH)).toString();
|
||||||
|
else
|
||||||
|
fileHash = finishedTorrentTab->getFinishedListModel()->data(finishedTorrentTab->getFinishedListModel()->index(index.row(), HASH)).toString();
|
||||||
torrent_handle h = BTSession.getTorrentHandle(fileHash);
|
torrent_handle h = BTSession.getTorrentHandle(fileHash);
|
||||||
previewSelection = new previewSelect(this, h);
|
previewSelection = new previewSelect(this, h);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user