bug correction in making treeview

This commit is contained in:
Daniel Tartavel 2023-03-01 15:50:37 +01:00
parent 3345a65b28
commit 7e736b524e

View File

@ -627,7 +627,7 @@ QTreeWidgetItem * MainWindow::addTreeChild(QTreeWidgetItem *parent, QString name
}else }else
{ {
// item is a file // item is a file
treeItem->setText(1,("File")); treeItem->setText(1,tr("File"));
} }
treeItem->setText(0, name); treeItem->setText(0, name);
treeItem->setText(2, fileSize); treeItem->setText(2, fileSize);
@ -737,6 +737,7 @@ void MainWindow::on_treeWidget_itemClicked(QTreeWidgetItem *item, bool downloadD
path.prepend(itemR->text(0) + "/"); path.prepend(itemR->text(0) + "/");
}; };
QFileInfo info(this->downloading.savePath + "/" + path); QFileInfo info(this->downloading.savePath + "/" + path);
cout << item->text(1).toStdString() <<endl;
if (item->text(1) == tr("File") or downloadDir == true) if (item->text(1) == tr("File") or downloadDir == true)
{ {
// Item is a file // Item is a file