added basic last run crash dialog
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "singletons/pathmanager.hpp"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QCryptographicHash>
|
||||
#include <QDir>
|
||||
#include <QStandardPaths>
|
||||
|
||||
@@ -15,6 +16,14 @@ PathManager &PathManager::getInstance()
|
||||
|
||||
bool PathManager::init(int argc, char **argv)
|
||||
{
|
||||
// hash of app path
|
||||
this->appPathHash = QCryptographicHash::hash(QCoreApplication::applicationFilePath().toUtf8(),
|
||||
QCryptographicHash::Sha224)
|
||||
.toBase64()
|
||||
.mid(0, 32)
|
||||
.replace("+", "-")
|
||||
.replace("/", "x");
|
||||
|
||||
// Options
|
||||
bool portable = false;
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
QString whispersLogsFolderPath;
|
||||
QString mentionsLogsFolderPath;
|
||||
|
||||
QString appPathHash;
|
||||
|
||||
bool createFolder(const QString &folderPath);
|
||||
};
|
||||
|
||||
|
||||
@@ -33,13 +33,8 @@ void UpdateManager::checkForUpdates()
|
||||
|
||||
util::NetworkRequest req(url);
|
||||
req.setTimeout(20000);
|
||||
req.getJSON([this](QJsonDocument &document) {
|
||||
if (document.isEmpty()) {
|
||||
qDebug() << "error updating";
|
||||
return;
|
||||
}
|
||||
|
||||
QJsonValue version_val = document.object().value("version");
|
||||
req.getJSON([this](QJsonObject &object) {
|
||||
QJsonValue version_val = object.value("version");
|
||||
if (!version_val.isString()) {
|
||||
qDebug() << "error updating";
|
||||
return;
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
const QString &getCurrentVersion() const;
|
||||
const QString &getOnlineVersion() const;
|
||||
|
||||
pajlada::Signals::Signal onlineVersionUpdated;
|
||||
pajlada::Signals::NoArgSignal onlineVersionUpdated;
|
||||
|
||||
private:
|
||||
QString currentVersion;
|
||||
|
||||
Reference in New Issue
Block a user