Files
spark-store/src/pages/appintopage.h
zty199 0c4f5dacca fix: 修复退出时崩溃问题
AppIntoPage 析构函数中使用 free 释放 rawHeaders 指针存在问题

Log: 使用 QByteArray 全局变量存储 User-Agent 字符串,无需使用指针,避免析构问题
2023-12-30 00:41:06 +08:00

57 lines
1.1 KiB
C++

#ifndef APPINTOPAGE_H
#define APPINTOPAGE_H
#include <QWidget>
#include <QJsonObject>
#include <QUrl>
namespace Ui {
class AppIntoPage;
}
class SparkAPI;
class DownloadListWidget;
class AppIntoPage : public QWidget
{
Q_OBJECT
public:
explicit AppIntoPage(QWidget *parent = nullptr);
~AppIntoPage() override;
void openUrl(const QUrl &url);
void clear();
void setTheme(bool dark);
void setDownloadWidget(DownloadListWidget *w);
private:
void initUI();
void initConnections();
void isDownloading(const QUrl &url);
void setAppinfoTags(const QStringList &tagList);
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport);
signals:
void clickedDownloadBtn();
private slots:
void on_downloadButton_clicked();
void on_pushButton_3_clicked();
void on_shareButton_clicked();
void on_updateButton_clicked();
private:
Ui::AppIntoPage *ui;
SparkAPI *api;
DownloadListWidget *dw = nullptr;
QJsonObject info;
QPixmap iconpixmap;
QUrl spk;
QByteArray m_userAgent;
};
#endif // APPINTOPAGE_H