mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 03:28:41 -07:00
Use polymorphism to distinguish folder / file items in torrent content model
Step to address issue #24.
This commit is contained in:
parent
30be83d445
commit
0fdacf4d54
13 changed files with 507 additions and 297 deletions
|
@ -412,7 +412,7 @@ void PropertiesWidget::loadUrlSeeds() {
|
|||
void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
||||
if (!index.isValid()) return;
|
||||
if (!h.is_valid() || !h.has_metadata()) return;
|
||||
if (PropListModel->getType(index) == TorrentContentModelItem::TFILE) {
|
||||
if (PropListModel->itemType(index) == TorrentContentModelItem::FileType) {
|
||||
int i = PropListModel->getFileIndex(index);
|
||||
const QDir saveDir(h.save_path());
|
||||
const QString filename = h.filepath_at(i);
|
||||
|
@ -514,7 +514,7 @@ void PropertiesWidget::renameSelectedFile() {
|
|||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
if (PropListModel->getType(index) == TorrentContentModelItem::TFILE) {
|
||||
if (PropListModel->itemType(index) == TorrentContentModelItem::FileType) {
|
||||
// File renaming
|
||||
const int file_index = PropListModel->getFileIndex(index);
|
||||
if (!h.is_valid() || !h.has_metadata()) return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue