Minimize amount of code to rebuild when switching options
This commit is contained in:
parent
3db0b11a6b
commit
1bde096417
|
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
|
||||||
cout << "Compression start, size: " << resultSize << "\n";
|
cout << "Compression start, size: " << resultSize << "\n";
|
||||||
|
|
||||||
QByteArray compressed, resultCheck;
|
QByteArray compressed, resultCheck;
|
||||||
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
|
#if defined Q_OS_WIN && !defined TDESKTOP_USE_PACKAGED // use Lzma SDK for win
|
||||||
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
||||||
|
|
||||||
compressed.resize(hSize + resultSize + 1024 * 1024); // rsa signature + sha1 + lzma props + max compressed size
|
compressed.resize(hSize + resultSize + 1024 * 1024); // rsa signature + sha1 + lzma props + max compressed size
|
||||||
|
|
|
@ -27,7 +27,7 @@ extern "C" {
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
|
#if defined Q_OS_WIN && !defined TDESKTOP_USE_PACKAGED // use Lzma SDK for win
|
||||||
#include <LzmaLib.h>
|
#include <LzmaLib.h>
|
||||||
#else
|
#else
|
||||||
#include <lzma.h>
|
#include <lzma.h>
|
||||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
#include <new.h>
|
#include <new.h>
|
||||||
|
@ -48,7 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
|
|
||||||
#endif // Q_OS_WIN
|
#endif // Q_OS_WIN
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
namespace CrashReports {
|
namespace CrashReports {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -59,7 +59,7 @@ using AnnotationRefs = std::map<std::string, const QString*>;
|
||||||
Annotations ProcessAnnotations;
|
Annotations ProcessAnnotations;
|
||||||
AnnotationRefs ProcessAnnotationRefs;
|
AnnotationRefs ProcessAnnotationRefs;
|
||||||
|
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
QString ReportPath;
|
QString ReportPath;
|
||||||
FILE *ReportFile = nullptr;
|
FILE *ReportFile = nullptr;
|
||||||
|
@ -290,7 +290,7 @@ bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context,
|
||||||
}
|
}
|
||||||
#endif // !Q_OS_MAC || MAC_USE_BREAKPAD
|
#endif // !Q_OS_MAC || MAC_USE_BREAKPAD
|
||||||
|
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ QString PlatformString() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartCatching() {
|
void StartCatching() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
ProcessAnnotations["Binary"] = cExeName().toUtf8().constData();
|
ProcessAnnotations["Binary"] = cExeName().toUtf8().constData();
|
||||||
ProcessAnnotations["ApiId"] = QString::number(ApiId).toUtf8().constData();
|
ProcessAnnotations["ApiId"] = QString::number(ApiId).toUtf8().constData();
|
||||||
ProcessAnnotations["Version"] = (cAlphaVersion()
|
ProcessAnnotations["Version"] = (cAlphaVersion()
|
||||||
|
@ -380,21 +380,21 @@ void StartCatching() {
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
#endif // else for Q_OS_WIN || Q_OS_MAC
|
#endif // else for Q_OS_WIN || Q_OS_MAC
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void FinishCatching() {
|
void FinishCatching() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
#if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD
|
#if !defined Q_OS_MAC || defined MAC_USE_BREAKPAD
|
||||||
|
|
||||||
delete base::take(BreakpadExceptionHandler);
|
delete base::take(BreakpadExceptionHandler);
|
||||||
|
|
||||||
#endif // !Q_OS_MAC || MAC_USE_BREAKPAD
|
#endif // !Q_OS_MAC || MAC_USE_BREAKPAD
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
StartResult Start() {
|
StartResult Start() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
ReportPath = cWorkingDir() + u"tdata/working"_q;
|
ReportPath = cWorkingDir() + u"tdata/working"_q;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
@ -420,12 +420,12 @@ StartResult Start() {
|
||||||
return lastdump;
|
return lastdump;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
return Restart();
|
return Restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
Status Restart() {
|
Status Restart() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
if (ReportFile) {
|
if (ReportFile) {
|
||||||
return Started;
|
return Started;
|
||||||
}
|
}
|
||||||
|
@ -470,13 +470,13 @@ Status Restart() {
|
||||||
LOG(("FATAL: Could not open '%1' for writing!").arg(ReportPath));
|
LOG(("FATAL: Could not open '%1' for writing!").arg(ReportPath));
|
||||||
|
|
||||||
return CantOpen;
|
return CantOpen;
|
||||||
#else // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#else // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
return Started;
|
return Started;
|
||||||
#endif // else for !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // else for !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void Finish() {
|
void Finish() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
FinishCatching();
|
FinishCatching();
|
||||||
|
|
||||||
if (ReportFile) {
|
if (ReportFile) {
|
||||||
|
@ -489,7 +489,7 @@ void Finish() {
|
||||||
unlink(ReportPath.toUtf8().constData());
|
unlink(ReportPath.toUtf8().constData());
|
||||||
#endif // else for Q_OS_WIN
|
#endif // else for Q_OS_WIN
|
||||||
}
|
}
|
||||||
#endif // !DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // !TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAnnotation(const std::string &key, const QString &value) {
|
void SetAnnotation(const std::string &key, const QString &value) {
|
||||||
|
@ -539,7 +539,7 @@ void SetAnnotationRef(const std::string &key, const QString *valuePtr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
dump::~dump() {
|
dump::~dump() {
|
||||||
if (ReportFile) {
|
if (ReportFile) {
|
||||||
|
@ -604,6 +604,6 @@ const dump &operator<<(const dump &stream, double num) {
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
} // namespace CrashReports
|
} // namespace CrashReports
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace CrashReports {
|
||||||
|
|
||||||
QString PlatformString();
|
QString PlatformString();
|
||||||
|
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
struct dump {
|
struct dump {
|
||||||
~dump();
|
~dump();
|
||||||
|
@ -24,7 +24,7 @@ const dump &operator<<(const dump &stream, unsigned long num);
|
||||||
const dump &operator<<(const dump &stream, unsigned long long num);
|
const dump &operator<<(const dump &stream, unsigned long long num);
|
||||||
const dump &operator<<(const dump &stream, double num);
|
const dump &operator<<(const dump &stream, double num);
|
||||||
|
|
||||||
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
CantOpen,
|
CantOpen,
|
||||||
|
|
|
@ -42,11 +42,11 @@ extern "C" {
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||||
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
|
#if defined Q_OS_WIN && !defined TDESKTOP_USE_PACKAGED // use Lzma SDK for win
|
||||||
#include <LzmaLib.h>
|
#include <LzmaLib.h>
|
||||||
#else // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#else // Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
#include <lzma.h>
|
#include <lzma.h>
|
||||||
#endif // else of Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#endif // else of Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
|
@ -275,11 +275,11 @@ bool UnpackUpdate(const QString &filepath) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
|
#if defined Q_OS_WIN && !defined TDESKTOP_USE_PACKAGED // use Lzma SDK for win
|
||||||
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
|
||||||
#else // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#else // Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header
|
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header
|
||||||
#endif // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#endif // Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
|
|
||||||
QByteArray compressed = input.readAll();
|
QByteArray compressed = input.readAll();
|
||||||
int32 compressedLen = compressed.size() - hSize;
|
int32 compressedLen = compressed.size() - hSize;
|
||||||
|
@ -350,14 +350,14 @@ bool UnpackUpdate(const QString &filepath) {
|
||||||
uncompressed.resize(uncompressedLen);
|
uncompressed.resize(uncompressedLen);
|
||||||
|
|
||||||
size_t resultLen = uncompressed.size();
|
size_t resultLen = uncompressed.size();
|
||||||
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
|
#if defined Q_OS_WIN && !defined TDESKTOP_USE_PACKAGED // use Lzma SDK for win
|
||||||
SizeT srcLen = compressedLen;
|
SizeT srcLen = compressedLen;
|
||||||
int uncompressRes = LzmaUncompress((uchar*)uncompressed.data(), &resultLen, (const uchar*)(compressed.constData() + hSize), &srcLen, (const uchar*)(compressed.constData() + hSigLen + hShaLen), LZMA_PROPS_SIZE);
|
int uncompressRes = LzmaUncompress((uchar*)uncompressed.data(), &resultLen, (const uchar*)(compressed.constData() + hSize), &srcLen, (const uchar*)(compressed.constData() + hSigLen + hShaLen), LZMA_PROPS_SIZE);
|
||||||
if (uncompressRes != SZ_OK) {
|
if (uncompressRes != SZ_OK) {
|
||||||
LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes));
|
LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#else // Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
lzma_stream stream = LZMA_STREAM_INIT;
|
lzma_stream stream = LZMA_STREAM_INIT;
|
||||||
|
|
||||||
lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED);
|
lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED);
|
||||||
|
@ -400,7 +400,7 @@ bool UnpackUpdate(const QString &filepath) {
|
||||||
LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res));
|
LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
|
#endif // Q_OS_WIN && !TDESKTOP_USE_PACKAGED
|
||||||
|
|
||||||
tempDir.mkdir(tempDir.absolutePath());
|
tempDir.mkdir(tempDir.absolutePath());
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/algorithm.h"
|
#include "base/algorithm.h"
|
||||||
#include "logs.h"
|
#include "logs.h"
|
||||||
|
|
||||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||||
#include "base/platform/linux/base_linux_library.h"
|
#include "base/platform/linux/base_linux_library.h"
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#endif // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
#endif // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||||
|
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||||
#endif // LIB_FFMPEG_USE_QT_PRIVATE_API
|
#endif // LIB_FFMPEG_USE_QT_PRIVATE_API
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||||
[[nodiscard]] auto CheckHwLibs() {
|
[[nodiscard]] auto CheckHwLibs() {
|
||||||
auto list = std::deque{
|
auto list = std::deque{
|
||||||
AV_PIX_FMT_CUDA,
|
AV_PIX_FMT_CUDA,
|
||||||
|
@ -116,7 +116,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
#endif // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
#endif // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||||
|
|
||||||
[[nodiscard]] bool InitHw(AVCodecContext *context, AVHWDeviceType type) {
|
[[nodiscard]] bool InitHw(AVCodecContext *context, AVHWDeviceType type) {
|
||||||
AVCodecContext *parent = static_cast<AVCodecContext*>(context->opaque);
|
AVCodecContext *parent = static_cast<AVCodecContext*>(context->opaque);
|
||||||
|
@ -158,9 +158,9 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
#if !defined DESKTOP_APP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
#if !defined TDESKTOP_USE_PACKAGED && !defined Q_OS_WIN && !defined Q_OS_MAC
|
||||||
static const auto list = CheckHwLibs();
|
static const auto list = CheckHwLibs();
|
||||||
#else // !DESKTOP_APP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
#else // !TDESKTOP_USE_PACKAGED && !Q_OS_WIN && !Q_OS_MAC
|
||||||
const auto list = std::array{
|
const auto list = std::array{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
AV_PIX_FMT_D3D11,
|
AV_PIX_FMT_D3D11,
|
||||||
|
@ -174,7 +174,7 @@ void PremultiplyLine(uchar *dst, const uchar *src, int intsCount) {
|
||||||
AV_PIX_FMT_CUDA,
|
AV_PIX_FMT_CUDA,
|
||||||
#endif // Q_OS_WIN || Q_OS_MAC
|
#endif // Q_OS_WIN || Q_OS_MAC
|
||||||
};
|
};
|
||||||
#endif // DESKTOP_APP_USE_PACKAGED || Q_OS_WIN || Q_OS_MAC
|
#endif // TDESKTOP_USE_PACKAGED || Q_OS_WIN || Q_OS_MAC
|
||||||
for (const auto format : list) {
|
for (const auto format : list) {
|
||||||
if (!has(format)) {
|
if (!has(format)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -155,10 +155,10 @@ std::optional<bool> IsDarkMode() {
|
||||||
#endif // Qt < 6.5.0
|
#endif // Qt < 6.5.0
|
||||||
|
|
||||||
void WriteCrashDumpDetails() {
|
void WriteCrashDumpDetails() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
double v = objc_appkitVersion();
|
double v = objc_appkitVersion();
|
||||||
CrashReports::dump() << "OS-Version: " << v;
|
CrashReports::dump() << "OS-Version: " << v;
|
||||||
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
// I do check for availability, just not in the exact way clang is content with
|
// I do check for availability, just not in the exact way clang is content with
|
||||||
|
|
|
@ -482,7 +482,7 @@ bool AutostartSkip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteCrashDumpDetails() {
|
void WriteCrashDumpDetails() {
|
||||||
#ifndef DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
PROCESS_MEMORY_COUNTERS data = { 0 };
|
PROCESS_MEMORY_COUNTERS data = { 0 };
|
||||||
if (Dlls::GetProcessMemoryInfo
|
if (Dlls::GetProcessMemoryInfo
|
||||||
&& Dlls::GetProcessMemoryInfo(
|
&& Dlls::GetProcessMemoryInfo(
|
||||||
|
@ -503,7 +503,7 @@ void WriteCrashDumpDetails() {
|
||||||
<< (data.PagefileUsage / mb)
|
<< (data.PagefileUsage / mb)
|
||||||
<< " MB (current)\n";
|
<< " MB (current)\n";
|
||||||
}
|
}
|
||||||
#endif // DESKTOP_APP_DISABLE_CRASH_REPORTS
|
#endif // TDESKTOP_DISABLE_CRASH_REPORTS
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetWindowPriority(not_null<QWidget*> window, uint32 priority) {
|
void SetWindowPriority(not_null<QWidget*> window, uint32 priority) {
|
||||||
|
|
|
@ -20,7 +20,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
#ifdef DESKTOP_APP_SPECIAL_TARGET
|
|
||||||
constexpr auto kMinimalSkip = 7;
|
constexpr auto kMinimalSkip = 7;
|
||||||
constexpr auto kSoonSkip = 30;
|
constexpr auto kSoonSkip = 30;
|
||||||
constexpr auto kNowSkip = 90;
|
constexpr auto kNowSkip = 90;
|
||||||
|
@ -148,14 +147,12 @@ void Closed(const QString &workingDir) {
|
||||||
reinterpret_cast<const char*>(&value),
|
reinterpret_cast<const char*>(&value),
|
||||||
sizeof(qint32)));
|
sizeof(qint32)));
|
||||||
}
|
}
|
||||||
#endif // DESKTOP_APP_SPECIAL_TARGET
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
object_ptr<RpWidget> CreateOutdatedBar(
|
object_ptr<RpWidget> CreateOutdatedBar(
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
const QString &workingPath) {
|
const QString &workingPath) {
|
||||||
#ifdef DESKTOP_APP_SPECIAL_TARGET
|
|
||||||
const auto date = Platform::WhenSystemBecomesOutdated();
|
const auto date = Platform::WhenSystemBecomesOutdated();
|
||||||
if (date.isNull()) {
|
if (date.isNull()) {
|
||||||
return { nullptr };
|
return { nullptr };
|
||||||
|
@ -178,9 +175,6 @@ object_ptr<RpWidget> CreateOutdatedBar(
|
||||||
wrap->show(anim::type::instant);
|
wrap->show(anim::type::instant);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
#else // DESKTOP_APP_SPECIAL_TARGET
|
|
||||||
return { nullptr };
|
|
||||||
#endif // DESKTOP_APP_SPECIAL_TARGET
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Ui
|
} // namespace Ui
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
the official desktop application for the Telegram messaging service.
|
||||||
|
|
||||||
|
For license and copyright information please follow this link:
|
||||||
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
*/
|
||||||
|
#include "ui/controls/window_outdated_bar.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
|
||||||
|
object_ptr<RpWidget> CreateOutdatedBar(
|
||||||
|
not_null<QWidget*> parent,
|
||||||
|
const QString &workingPath) {
|
||||||
|
return { nullptr };
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Ui
|
|
@ -261,6 +261,7 @@ PRIVATE
|
||||||
ui/controls/who_reacted_context_action.cpp
|
ui/controls/who_reacted_context_action.cpp
|
||||||
ui/controls/who_reacted_context_action.h
|
ui/controls/who_reacted_context_action.h
|
||||||
ui/controls/window_outdated_bar.cpp
|
ui/controls/window_outdated_bar.cpp
|
||||||
|
ui/controls/window_outdated_bar_dummy.cpp
|
||||||
ui/controls/window_outdated_bar.h
|
ui/controls/window_outdated_bar.h
|
||||||
ui/effects/fireworks_animation.cpp
|
ui/effects/fireworks_animation.cpp
|
||||||
ui/effects/fireworks_animation.h
|
ui/effects/fireworks_animation.h
|
||||||
|
@ -331,6 +332,16 @@ PRIVATE
|
||||||
ui/ui_pch.h
|
ui/ui_pch.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (DESKTOP_APP_SPECIAL_TARGET)
|
||||||
|
remove_target_sources(td_ui ${src_loc}
|
||||||
|
ui/controls/window_outdated_bar_dummy.cpp
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
remove_target_sources(td_ui ${src_loc}
|
||||||
|
ui/controls/window_outdated_bar.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(td_ui
|
target_include_directories(td_ui
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${src_loc}
|
${src_loc}
|
||||||
|
|
|
@ -40,6 +40,14 @@ if (DESKTOP_APP_DISABLE_AUTOUPDATE)
|
||||||
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE)
|
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_AUTOUPDATE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DESKTOP_APP_DISABLE_CRASH_REPORTS)
|
||||||
|
target_compile_definitions(Telegram PRIVATE TDESKTOP_DISABLE_CRASH_REPORTS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (DESKTOP_APP_USE_PACKAGED)
|
||||||
|
target_compile_definitions(Telegram PRIVATE TDESKTOP_USE_PACKAGED)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (DESKTOP_APP_SPECIAL_TARGET)
|
if (DESKTOP_APP_SPECIAL_TARGET)
|
||||||
target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
|
target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 28db382a7471854fea4d41133becdcc6c161d907
|
Subproject commit 6de11e6ab705f27158f338e3e17c8b0767750721
|
|
@ -1 +1 @@
|
||||||
Subproject commit e240a2de8e67c806894caf04ee32797e75c6ea38
|
Subproject commit 1a700e5a0d7c3e2f617530354ff2a47c5c72bb4a
|
|
@ -1 +1 @@
|
||||||
Subproject commit a33bd4e0a590fb08f0055b6e859ce84db11eb843
|
Subproject commit d3ac9dcf97494aa1acfbfd8b6c0a3f57950e4962
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit 18d4aae269c51d5b24e96957abbdb389a1270122
|
Subproject commit 0ae4e78a12d7fdea687ca52647465b9cf9ef95ee
|
Loading…
Reference in New Issue