2 Star 11 Fork 4

呐喊 / 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
C++
1
https://gitee.com/hlinfo/autoUpdater.git
git@gitee.com:hlinfo/autoUpdater.git
hlinfo
autoUpdater
autoUpdater
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891