mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
fix: 修复下载列表对话框中,点击某个 item 取消下载按钮后下载列表无法再次显示的问题
MainWindow::notify 中焦点判断异常,未去除 QStyleSheetStyle 导致错误认为需要隐藏下载管理对话框 Log: 判断 focusIn 事件前排除 QStyleSheetStyle 对象
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
#include "downloadlistwidget.h"
|
||||
#include "ui_downloadlistwidget.h"
|
||||
#include <QGraphicsOpacityEffect>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QDebug>
|
||||
#include "widgets/common/downloaditem.h"
|
||||
#include "backend/sparkapi.h"
|
||||
#include "backend/downloadworker.h"
|
||||
#include "utils/utils.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QtConcurrent>
|
||||
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
DownloadListWidget::DownloadListWidget(QWidget *parent) : DBlurEffectWidget(parent),
|
||||
ui(new Ui::DownloadListWidget)
|
||||
@@ -118,14 +121,12 @@ void DownloadListWidget::startRequest(QUrl url, QString fileName)
|
||||
isdownload = true;
|
||||
downloaditemlist[allDownload - 1]->free = false;
|
||||
|
||||
|
||||
// 使用懒汉式单例来存储downloadController
|
||||
if (downloadController == nullptr)
|
||||
{
|
||||
downloadController = new DownloadController; // 并发下载,在第一次点击下载按钮的时候才会初始化
|
||||
}
|
||||
|
||||
|
||||
if (downloadController)
|
||||
{
|
||||
downloadController->disconnect();
|
||||
@@ -139,7 +140,6 @@ void DownloadListWidget::startRequest(QUrl url, QString fileName)
|
||||
downloadController->startDownload(url.toString());
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************
|
||||
* @brief 下载列表完成下载的回调函数
|
||||
* @param
|
||||
@@ -178,8 +178,6 @@ void DownloadListWidget::httpFinished() // 完成下载
|
||||
startRequest(urList.at(nowDownload - 1), fileName);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
void DownloadListWidget::updateDataReadProgress(QString speedInfo, qint64 bytesRead, qint64 totalBytes)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
#ifndef DOWNLOADLISTWIDGET_H
|
||||
#define DOWNLOADLISTWIDGET_H
|
||||
|
||||
#include <DBlurEffectWidget>
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <DBlurEffectWidget>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QDesktopServices>
|
||||
#include "widgets/common/downloaditem.h"
|
||||
#include "backend/sparkapi.h"
|
||||
#include "backend/downloadworker.h"
|
||||
#include "utils/utils.h"
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
namespace Ui {
|
||||
class DownloadListWidget;
|
||||
}
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class DownloadItem;
|
||||
class DownloadController;
|
||||
class DownloadListWidget : public DBlurEffectWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Reference in New Issue
Block a user