From f2604b62b777d7cab001bb5b7d80ad25b586e554 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 1 Feb 2018 07:24:43 +0100 Subject: Improve FileCopier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This endeavor started out quite innocently: fix the connect syntax in ProgressDialog, but it quickly became much more. Vom Höxchen aufs Stöxchen :) First I thought it would be nice to add a total count to the ProgressDialog. Then I realized that I had QElapsedTimer::restart() totally wrong. It returns the ms *since the last restart*! It doesn't reset to zero, so fix that. While testing that I noticed that the download speed was quite below average, so change the buffer size and only check if we were cancelled when the timer elapsed. But that wasn't it. Eventually I dug into my firewall rules and routings to get it right. --- progressdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'progressdialog.cpp') diff --git a/progressdialog.cpp b/progressdialog.cpp index d95f1e1..0690d65 100644 --- a/progressdialog.cpp +++ b/progressdialog.cpp @@ -10,7 +10,7 @@ ProgressDialog::ProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(par mProgress = new QProgressBar; mSum = new QLabel(tr("Wait for it...")); QPushButton *cancelBtn = new QPushButton(tr("Cancel")); - connect(cancelBtn, SIGNAL(clicked()), this, SIGNAL(cancelled())); + connect(cancelBtn, &QPushButton::clicked, this, &ProgressDialog::cancelled); QHBoxLayout *btnLayout = new QHBoxLayout; btnLayout->addStretch(); btnLayout->addWidget(cancelBtn); -- cgit v1.2.3-70-g09d2