summaryrefslogtreecommitdiffstats
path: root/torrentwidget.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2022-04-16 12:50:41 +0200
committerArno <arno@disconnect.de>2022-04-16 12:50:41 +0200
commit8335bd7751656c72aa5457013a6b09dbec1a6405 (patch)
treefe2cf85294a4e099222a751f6542826521793f9d /torrentwidget.cpp
parentc6b7fe4a6294e23bf04ff71799e5474ebe1d7875 (diff)
downloadShemovCleaner-master.tar.gz
ShemovCleaner-master.tar.bz2
ShemovCleaner-master.zip
Show first file in TorrentWidgetHEADmaster
When a torrent file is parseable, show the first filename in the view.
Diffstat (limited to 'torrentwidget.cpp')
-rw-r--r--torrentwidget.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp
index ec83424..5279b88 100644
--- a/torrentwidget.cpp
+++ b/torrentwidget.cpp
@@ -176,7 +176,7 @@ void TorrentWidget::gatherData(){
mFileView->setSortingEnabled(false);
mModel->clear();
QStandardItem *root = mModel->invisibleRootItem();
- mModel->setHorizontalHeaderLabels(QStringList() << QChar(0x26A7) << tr("Name") << tr("Created"));
+ mModel->setHorizontalHeaderLabels(QStringList() << QChar(0x26A7) << tr("Name") << tr("Content") << tr("Created"));
QBrush redBrush(Qt::red);
QBrush greenBrush(Qt::darkGreen);
for(const auto &fi : fl){
@@ -189,6 +189,12 @@ void TorrentWidget::gatherData(){
}
fData << item;
}
+ TorrentParser p(fi.absoluteFilePath());
+ const auto tData = p.parse();
+ const auto tFiles = p.files(tData);
+ if(!tFiles.isEmpty()){
+ fData[ContentColumn]->setText(tFiles.at(0));
+ }
int result = 0;
q.bindValue(":fn", fi.fileName());
q.exec();