Plasma Engine  2.0
Loading...
Searching...
No Matches
CheckVersion.moc.h
1#pragma once
2
3#include <EditorFramework/EditorFrameworkDLL.h>
4
5#include <Foundation/Strings/String.h>
6
7#include <Foundation/Types/UniquePtr.h>
8#include <QObject>
9#include <QProcess>
10
11class PageDownloader : public QObject
12{
13 Q_OBJECT
14
15public:
16 explicit PageDownloader(const QString& sUrl);
17
18 plStringView GetDownloadedData() const { return m_sDownloadedPage; }
19
20signals:
21 void FinishedDownload();
22
23private slots:
24 void DownloadDone(int exitCode, QProcess::ExitStatus exitStatus);
25
26private:
27 plUniquePtr<QProcess> m_pProcess;
28 plStringBuilder m_sDownloadedPage;
29};
30
32class plQtVersionChecker : public QObject
33{
34 Q_OBJECT
35
36public:
38
39 void Initialize();
40
41 bool Check(bool bForce);
42
43 const char* GetOwnVersion() const;
44 const char* GetKnownLatestVersion() const;
45
46 bool IsLatestNewer() const;
47
48Q_SIGNALS:
49 void VersionCheckCompleted(bool bNewRelease, bool bForced);
50
51private slots:
52 void PageDownloaded();
53
54 plResult StoreKnownVersion();
55
56private:
57 bool m_bRequireOnlineCheck = true;
58 bool m_bForceCheck = false;
59 bool m_bCheckInProgresss = false;
60 plString m_sConfigFile;
61 plString m_sKnownLatestVersion;
62 plUniquePtr<PageDownloader> m_pVersionPage;
63};
Definition CheckVersion.moc.h:12
Downloads a web page and checks whether the latest version online is newer than the current one.
Definition CheckVersion.moc.h:33
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54