1 Star 0 Fork 5

策略定制/autoUpdater

forked from 呐喊/autoUpdater 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
handleziptype.h 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
呐喊 提交于 2022-07-27 21:41 . V1.0.1 Release
#ifndef HANDLEZIPTYPE_H
#define HANDLEZIPTYPE_H
#include <QtNetwork>
//#include <QProgressDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QUrl>
#include <QFile>
#include <QObject>
//#include <QDialog>
#include "QtGui/private/qzipreader_p.h" //zip解压
//#include "QtGui/private/qzipwriter_p.h" //zip压缩
#include <QEventLoop>
#include <QFileInfoList>
#include "globalval.h"
#include <memory>
QT_BEGIN_NAMESPACE
class QFile;
//class QSslError;
class QNetworkReply;
class GlobalVal;
QT_END_NAMESPACE
class HandleZipType : public QObject
{
Q_OBJECT
public:
HandleZipType(QObject *parent = nullptr);
~HandleZipType();
void downloadZip(QUrl url);
QString downloadProgress;
private:
QUrl url;
QNetworkAccessManager *manager;
QNetworkReply *reply;
std::unique_ptr<QFile> file;
bool httpRequestAborted;
std::unique_ptr<QFile> openFileForWrite(const QString &fileName);
QString originFileName;
QString zipFilePath;
QString tempDir;
private slots:
void startRequest(const QUrl &requestedUrl);
void cancelDownload();
void httpFinished();
void httpReadyRead();
void httpError();
void networkReplyProgress(qint64 bytesRead, qint64 totalBytes);
bool unzip(QString zipurl);
bool cpdir(QString fromDir,QString toDir,bool f);
signals:
void sendMsg(QString msg);
};
#endif // HANDLEZIPTYPE_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/kitegit/autoUpdater.git
git@gitee.com:kitegit/autoUpdater.git
kitegit
autoUpdater
autoUpdater
master

搜索帮助