From 7a5f472dfefde94e161aa3037df5368212712fea Mon Sep 17 00:00:00 2001 From: a-sum-duma Date: Tue, 26 Jul 2022 10:23:31 +0200 Subject: [PATCH] Fix: Download process wasn't starting ...if qnapi was already in tray --- gui/src/qnapiapp.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gui/src/qnapiapp.cpp b/gui/src/qnapiapp.cpp index 9469d08..0c857ed 100644 --- a/gui/src/qnapiapp.cpp +++ b/gui/src/qnapiapp.cpp @@ -47,6 +47,14 @@ QNapiApp::QNapiApp(int &argc, char **argv, const QString &appName) napisy24SubMenu = 0; trayIconMenu = 0; trayIcon = 0; + + connect( + this, &QNapiApp::downloadFile, + this, [this] (const QString &path) { progress()->receiveRequest(path); }); + + connect( // ### Qt 5.7 use QOverload + this, static_cast(&QNapiApp::request), + this, &QNapiApp::downloadFile); } QNapiApp::~QNapiApp() { @@ -80,10 +88,6 @@ frmProgress *QNapiApp::progress() { if (!f_progress) { f_progress = new frmProgress(); if (!f_progress) abort(); - connect(this, SIGNAL(request(QString)), f_progress, - SLOT(receiveRequest(QString))); - connect(this, SIGNAL(downloadFile(const QString &)), f_progress, - SLOT(receiveRequest(const QString &))); } return f_progress; }