mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
Fix properties display for torrents without metadata
This commit is contained in:
@@ -237,30 +237,34 @@ void PropertiesWidget::loadTorrentInfos(QTorrentHandle &_h) {
|
||||
clear();
|
||||
h = _h;
|
||||
if(!h.is_valid()) {
|
||||
qDebug("Properties: invalid handle, returning.");
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
setEnabled(true);
|
||||
|
||||
PropListModel->clear();
|
||||
try {
|
||||
// Save path
|
||||
updateSavePath(h);
|
||||
changeSavePathButton->setEnabled(h.has_metadata());
|
||||
// Creation date
|
||||
lbl_creationDate->setText(h.creation_date());
|
||||
// Hash
|
||||
hash_lbl->setText(h.hash());
|
||||
if(h.has_metadata()) {
|
||||
// Creation date
|
||||
lbl_creationDate->setText(h.creation_date());
|
||||
// Comment
|
||||
comment_text->setHtml(h.comment());
|
||||
// URL seeds
|
||||
loadUrlSeeds();
|
||||
// List files in torrent
|
||||
PropListModel->clear();
|
||||
PropListModel->setupModelData(h.get_torrent_info());
|
||||
// Expand first item if possible
|
||||
filesList->expand(PropListModel->index(0, 0));
|
||||
}
|
||||
} catch(invalid_handle e) {
|
||||
|
||||
qDebug("Properties: INVALID HANDLE");
|
||||
qDebug("what() == %s", e.what());
|
||||
}
|
||||
// Load dynamic data
|
||||
loadDynamicData();
|
||||
|
||||
Reference in New Issue
Block a user