From 0b0122943f57ba5d69433b6ec8f1bd502defcbea Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 22 Sep 2016 09:03:56 +0200 Subject: Ask if torrentcount > 100 It'll take a long time, so give the user a chance to cancel. --- torrentwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'torrentwidget.cpp') diff --git a/torrentwidget.cpp b/torrentwidget.cpp index 08c9a86..83faa1c 100644 --- a/torrentwidget.cpp +++ b/torrentwidget.cpp @@ -159,6 +159,13 @@ void TorrentWidget::gatherData(){ mProgressBar->reset(); mProgressBar->setMinimum(0); mProgressBar->setMaximum(fl.count() - 1); + if(fl.count() > 100){ + QString msg = QString(tr("

Looking at %1 files could take a while

Do you really want to continue

")).arg(QString::number(fl.count())); + int retval = QMessageBox::question(this, tr("Continue"), msg); + if(retval == QMessageBox::No){ + return; + } + } int count = 0; mFileView->setSortingEnabled(false); mModel->clear(); -- cgit v1.2.3-70-g09d2