mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-10 17:35:00 -06:00
BUGFIX: Properly display torrents with one file in subfolder(s)
This commit is contained in:
@@ -498,7 +498,14 @@ public:
|
||||
files_index = new TreeItem*[t.num_files()];
|
||||
|
||||
TreeItem *parent = this->rootItem;
|
||||
if(t.num_files() ==1) {
|
||||
if(t.num_files() == 1) {
|
||||
// Create possible parent folder
|
||||
QStringList path_parts = misc::toQString(t.file_at(0).path.string()).split(QDir::separator());
|
||||
path_parts.removeLast();
|
||||
foreach(const QString &part, path_parts) {
|
||||
TreeItem *folder = new TreeItem(part, parent);
|
||||
parent = folder;
|
||||
}
|
||||
TreeItem *f = new TreeItem(t.file_at(0), parent, 0);
|
||||
//parent->appendChild(f);
|
||||
files_index[0] = f;
|
||||
|
||||
Reference in New Issue
Block a user