2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

added user tag for reports, fixed couple of compile warnings in gcc

This commit is contained in:
John Preston
2016-02-15 18:52:11 +03:00
parent ebd77ba71d
commit 71e544e0fc
7 changed files with 43 additions and 4 deletions

View File

@@ -215,6 +215,7 @@ struct SandboxDataStruct {
ConnectionProxy PreLaunchProxy;
};
SandboxDataStruct *SandboxData = 0;
uint64 SandboxUserTag = 0;
namespace Sandbox {
@@ -276,6 +277,27 @@ namespace Sandbox {
f.write("1");
}
}
srand((int32)time(NULL));
SandboxUserTag = 0;
QFile usertag(cWorkingDir() + qsl("tdata/usertag"));
if (usertag.open(QIODevice::ReadOnly)) {
if (usertag.read(reinterpret_cast<char*>(&SandboxUserTag), sizeof(uint64)) != sizeof(uint64)) {
SandboxUserTag = 0;
}
usertag.close();
}
if (!SandboxUserTag) {
do {
memsetrnd_bad(SandboxUserTag);
} while (!SandboxUserTag);
if (usertag.open(QIODevice::WriteOnly)) {
usertag.write(reinterpret_cast<char*>(&SandboxUserTag), sizeof(uint64));
usertag.close();
}
}
}
void start() {
@@ -290,8 +312,6 @@ namespace Sandbox {
break;
}
}
srand((int32)time(NULL));
}
void finish() {
@@ -299,6 +319,10 @@ namespace Sandbox {
SandboxData = 0;
}
uint64 UserTag() {
return SandboxUserTag;
}
DefineReadOnlyVar(Sandbox, QString, LangSystemISO);
DefineReadOnlyVar(Sandbox, int32, LangSystem);
DefineVar(Sandbox, QByteArray, LastCrashDump);