added basic last run crash dialog

This commit is contained in:
fourtf
2018-04-20 00:15:57 +02:00
parent 683c4aed2d
commit e17a7cc222
10 changed files with 73 additions and 10 deletions
+9
View File
@@ -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;
+2
View File
@@ -29,6 +29,8 @@ public:
QString whispersLogsFolderPath;
QString mentionsLogsFolderPath;
QString appPathHash;
bool createFolder(const QString &folderPath);
};
+2 -7
View File
@@ -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;
+1 -1
View File
@@ -17,7 +17,7 @@ public:
const QString &getCurrentVersion() const;
const QString &getOnlineVersion() const;
pajlada::Signals::Signal onlineVersionUpdated;
pajlada::Signals::NoArgSignal onlineVersionUpdated;
private:
QString currentVersion;