-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateapp.h
More file actions
63 lines (52 loc) · 1.4 KB
/
updateapp.h
File metadata and controls
63 lines (52 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef UPDATEAPP_H
#define UPDATEAPP_H
#include <QObject>
#include <QString>
#include <QFile>
#include <QCoreApplication>
#include <QRegExp>
#include <QDebug>
#include <QThread>
#include <QStringList>
#include <QProcess>
#include "downloadfile.h"
#ifdef Q_OS_WIN
#include <windows.h>
#include <shellapi.h>
#endif
class UpdateApp : public QObject
{
Q_OBJECT
public:
explicit UpdateApp(QObject *parent = 0);
QStringList ParseFile(const QString& path_file);
bool CompareVersions(const QString& new_version);
bool CheckFile(const QString& path_file);
bool DownloadAnyFile(const QString& url_path);
private:
static QRegExp reg_exp;
static const QString url_inf_file;
//static const QString url_app_file;
static const QString inf_file;
static const QString inf_file_prefix;
static const QString app_win_file_prefix;
static const QString app_mac_file_prefix;
static const QString begin_url_new_file;
//for metrics
public:
static const QString APP_VERSION;
private:
static const QString url_win_app_file;
static const QString url_mac_app_file;
QStringList new_version;
signals:
void sigUpdateOrReject();
void sigAcceptDownload();
void sigRejectDownload();
public slots:
void slotDoneLoad(const QString& file_name);
bool slotCheckUpdate();
void slotAcceptDownload();
void slotRejectDownload();
};
#endif // UPDATEAPP_H