diff --git a/Telegram/SourceFiles/_other/updater_osx.m b/Telegram/SourceFiles/_other/updater_osx.m index c93fba25a..cf471db1e 100644 --- a/Telegram/SourceFiles/_other/updater_osx.m +++ b/Telegram/SourceFiles/_other/updater_osx.m @@ -53,10 +53,10 @@ void RemoveQuarantineAttribute(NSString *path) { } void RemoveQuarantineFromBundle(NSString *path) { - RemoveQuarantineAttribute(path); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Telegram"]); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]); - RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]); + RemoveQuarantineAttribute(path); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/MacOS/Telegram"]); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Helpers/crashpad_handler"]); + RemoveQuarantineAttribute([path stringByAppendingString:@"/Contents/Frameworks/Updater"]); } void delFolder() { diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index e783d4a62..f5b103af8 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -316,12 +316,12 @@ namespace App { } QImage readImage(QByteArray data, QByteArray *format, bool opaque, bool *animated) { - QByteArray tmpFormat; + QByteArray tmpFormat; QImage result; QBuffer buffer(&data); - if (!format) { - format = &tmpFormat; - } + if (!format) { + format = &tmpFormat; + } { QImageReader reader(&buffer, *format); #ifndef OS_MAC_OLD diff --git a/Telegram/SourceFiles/core/crash_report_window.cpp b/Telegram/SourceFiles/core/crash_report_window.cpp index 44ee32d85..3af3dea51 100644 --- a/Telegram/SourceFiles/core/crash_report_window.cpp +++ b/Telegram/SourceFiles/core/crash_report_window.cpp @@ -268,25 +268,25 @@ LastCrashedWindow::LastCrashedWindow( } if (_minidumpFull.isEmpty()) { QString maxDump, maxDumpFull; - QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); + QDateTime maxDumpModified, workingModified = QFileInfo(cWorkingDir() + qsl("tdata/working")).lastModified(); QFileInfoList list = QDir(dumpspath).entryInfoList(); - for (int32 i = 0, l = list.size(); i < l; ++i) { - QString name = list.at(i).fileName(); - if (name.endsWith(qstr(".dmp"))) { - QDateTime modified = list.at(i).lastModified(); - if (maxDump.isEmpty() || qAbs(workingModified.secsTo(modified)) < qAbs(workingModified.secsTo(maxDumpModified))) { - maxDump = name; - maxDumpModified = modified; - maxDumpFull = list.at(i).absoluteFilePath(); - dumpsize = list.at(i).size(); - } - } - } - if (!maxDump.isEmpty() && qAbs(workingModified.secsTo(maxDumpModified)) < 10) { - _minidumpName = maxDump; - _minidumpFull = maxDumpFull; - } - } + for (int32 i = 0, l = list.size(); i < l; ++i) { + QString name = list.at(i).fileName(); + if (name.endsWith(qstr(".dmp"))) { + QDateTime modified = list.at(i).lastModified(); + if (maxDump.isEmpty() || qAbs(workingModified.secsTo(modified)) < qAbs(workingModified.secsTo(maxDumpModified))) { + maxDump = name; + maxDumpModified = modified; + maxDumpFull = list.at(i).absoluteFilePath(); + dumpsize = list.at(i).size(); + } + } + } + if (!maxDump.isEmpty() && qAbs(workingModified.secsTo(maxDumpModified)) < 10) { + _minidumpName = maxDump; + _minidumpFull = maxDumpFull; + } + } if (_minidumpName.isEmpty()) { // currently don't accept crash reports without dumps from google libraries _sendingState = SendingNoReport; } else { diff --git a/Telegram/SourceFiles/core/crash_report_window.h b/Telegram/SourceFiles/core/crash_report_window.h index 16507c744..3f07d5963 100644 --- a/Telegram/SourceFiles/core/crash_report_window.h +++ b/Telegram/SourceFiles/core/crash_report_window.h @@ -241,7 +241,7 @@ public: protected: void resizeEvent(QResizeEvent *e); - void closeEvent(QCloseEvent *e); + void closeEvent(QCloseEvent *e); private: PreLaunchLog _log; diff --git a/Telegram/SourceFiles/core/crash_reports.cpp b/Telegram/SourceFiles/core/crash_reports.cpp index f4b11d6ab..b88c62edd 100644 --- a/Telegram/SourceFiles/core/crash_reports.cpp +++ b/Telegram/SourceFiles/core/crash_reports.cpp @@ -201,13 +201,13 @@ void SignalHandler(int signum) { if (name) { dump() << "Caught signal " << signum << " (" << name << ") in thread " << uint64(thread) << "\n"; } else if (signum == -1) { - dump() << "Google Breakpad caught a crash, minidump written in thread " << uint64(thread) << "\n"; - if (BreakpadDumpPath) { - dump() << "Minidump: " << BreakpadDumpPath << "\n"; - } else if (BreakpadDumpPathW) { - dump() << "Minidump: " << BreakpadDumpPathW << "\n"; - } - } else { + dump() << "Google Breakpad caught a crash, minidump written in thread " << uint64(thread) << "\n"; + if (BreakpadDumpPath) { + dump() << "Minidump: " << BreakpadDumpPath << "\n"; + } else if (BreakpadDumpPathW) { + dump() << "Minidump: " << BreakpadDumpPathW << "\n"; + } + } else { dump() << "Caught signal " << signum << " in thread " << uint64(thread) << "\n"; } @@ -246,18 +246,18 @@ void SignalHandler(int signum) { #endif } - void *addresses[132] = { 0 }; + void *addresses[132] = { 0 }; size_t size = backtrace(addresses, 128); /* overwrite sigaction with caller's address */ - if (caller) { - for (int i = size; i > 1; --i) { - addresses[i + 3] = addresses[i]; - } - addresses[2] = (void*)0x1; - addresses[3] = caller; - addresses[4] = (void*)0x1; - } + if (caller) { + for (int i = size; i > 1; --i) { + addresses[i + 3] = addresses[i]; + } + addresses[2] = (void*)0x1; + addresses[3] = caller; + addresses[4] = (void*)0x1; + } #ifdef Q_OS_MAC dump() << "\nBase image addresses:\n"; @@ -302,14 +302,14 @@ bool DumpCallback(const google_breakpad::MinidumpDescriptor &md, void *context, CrashLogged = true; #ifdef Q_OS_WIN - BreakpadDumpPathW = _minidump_id; + BreakpadDumpPathW = _minidump_id; SignalHandler(-1); #else // Q_OS_WIN #ifdef Q_OS_MAC - BreakpadDumpPath = _minidump_id; + BreakpadDumpPath = _minidump_id; #else // Q_OS_MAC - BreakpadDumpPath = md.path(); + BreakpadDumpPath = md.path(); #endif // else for Q_OS_MAC SignalHandler(-1, 0, 0); #endif // else for Q_OS_WIN @@ -382,12 +382,13 @@ void StartCatching(not_null launcher) { crashpad::CrashpadClient crashpad_client; std::string handler = (cExeDir() + cExeName() + qsl("/Contents/Helpers/crashpad_handler")).toUtf8().constData(); std::string database = QFile::encodeName(dumpspath).constData(); - if (crashpad_client.StartHandler(base::FilePath(handler), - base::FilePath(database), - std::string(), - ProcessAnnotations, - std::vector(), - false)) { + if (crashpad_client.StartHandler( + base::FilePath(handler), + base::FilePath(database), + std::string(), + ProcessAnnotations, + std::vector(), + false)) { crashpad_client.UseHandler(); } #endif // else for MAC_USE_BREAKPAD @@ -580,20 +581,20 @@ const dump &operator<<(const dump &stream, const char *str) { } const dump &operator<<(const dump &stream, const wchar_t *str) { - if (!ReportFile) return stream; + if (!ReportFile) return stream; - for (int i = 0, l = wcslen(str); i < l; ++i) { - if ( + for (int i = 0, l = wcslen(str); i < l; ++i) { + if ( #if !defined(__WCHAR_UNSIGNED__) - str[i] >= 0 && + str[i] >= 0 && #endif - str[i] < 128) { + str[i] < 128) { SafeWriteChar(char(str[i])); - } else { + } else { SafeWriteChar('?'); - } - } - return stream; + } + } + return stream; } const dump &operator<<(const dump &stream, int num) { diff --git a/Telegram/SourceFiles/export/view/export_view_settings.h b/Telegram/SourceFiles/export/view/export_view_settings.h index facc3efe8..2c697128c 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.h +++ b/Telegram/SourceFiles/export/view/export_view_settings.h @@ -65,7 +65,7 @@ private: const QString &text, Types types, const QString &about); - void addChatOption( + void addChatOption( not_null container, const QString &text, Types types); diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 5cd761aeb..8e473b601 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -116,7 +116,7 @@ public: void leaveToChildEvent(QEvent *e, QWidget *child) override; void dragEnterEvent(QDragEnterEvent *e) override; void dragLeaveEvent(QDragLeaveEvent *e) override; - void dropEvent(QDropEvent *e) override; + void dropEvent(QDropEvent *e) override; bool isItemCompletelyHidden(HistoryItem *item) const; void updateTopBarSelection(); diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index f955eac8f..561d106ef 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -96,7 +96,7 @@ int32 documentColorIndex(DocumentData *document, QString &ext) { ? document->mimeString().toLower() : QString(); if (name.endsWith(qstr(".doc")) || - name.endsWith(qstr(".docx")) || + name.endsWith(qstr(".docx")) || name.endsWith(qstr(".txt")) || name.endsWith(qstr(".psd")) || mime.startsWith(qstr("text/"))) { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 7222f06c7..8d9ab6490 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -3492,7 +3492,7 @@ void MainWidget::activate() { if (!_mainSection) { if (_hider) { _dialogs->setInnerFocus(); - } else if (App::wnd() && !Ui::isLayerShown()) { + } else if (App::wnd() && !Ui::isLayerShown()) { if (!cSendPaths().isEmpty()) { const auto interpret = qstr("interpret://"); const auto path = cSendPaths()[0]; diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index ccbd607f5..ad106e581 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -558,7 +558,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *e) { } void MainWindow::updateTrayMenu(bool force) { - if (!trayIconMenu || (Platform::IsWindows() && !force)) return; + if (!trayIconMenu || (Platform::IsWindows() && !force)) return; auto iconMenu = trayIconMenu; auto actions = iconMenu->actions(); @@ -589,12 +589,12 @@ void MainWindow::updateTrayMenu(bool force) { notificationAction->setText(notificationActionText); #ifndef Q_OS_WIN - if (trayIcon && trayIcon->contextMenu() != iconMenu) { + if (trayIcon && trayIcon->contextMenu() != iconMenu) { trayIcon->setContextMenu(iconMenu); - } + } #endif // !Q_OS_WIN - psTrayMenuUpdated(); + psTrayMenuUpdated(); } void MainWindow::onShowAddContact() { @@ -694,7 +694,7 @@ void MainWindow::showFromTray(QSystemTrayIcon::ActivationReason reason) { updateTrayMenu(); updateGlobalMenu(); }); - activate(); + activate(); Notify::unreadCounterUpdated(); } } diff --git a/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h index c3ae32324..338c81a15 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h +++ b/Telegram/SourceFiles/mtproto/mtproto_rpc_sender.h @@ -96,7 +96,7 @@ class RPCDoneHandlerBare : public RPCAbstractDoneHandler { // done(from, end) using CallbackType = bool (*)(const mtpPrime *, const mtpPrime *); public: - RPCDoneHandlerBare(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerBare(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return (*_onDone)(from, end); @@ -111,7 +111,7 @@ class RPCDoneHandlerBareReq : public RPCAbstractDoneHandler { // done(from, end, using CallbackType = bool (*)(const mtpPrime *, const mtpPrime *, mtpRequestId); public: - RPCDoneHandlerBareReq(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerBareReq(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return (*_onDone)(from, end, requestId); @@ -127,7 +127,7 @@ class RPCDoneHandlerPlain : public RPCAbstractDoneHandler { // done(result) using CallbackType = TReturn (*)(const TResponse &); public: - RPCDoneHandlerPlain(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerPlain(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -148,7 +148,7 @@ class RPCDoneHandlerReq : public RPCAbstractDoneHandler { // done(result, req_id using CallbackType = TReturn (*)(const TResponse &, mtpRequestId); public: - RPCDoneHandlerReq(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerReq(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -169,7 +169,7 @@ class RPCDoneHandlerNo : public RPCAbstractDoneHandler { // done() using CallbackType = TReturn (*)(); public: - RPCDoneHandlerNo(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerNo(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { (*_onDone)(); @@ -186,7 +186,7 @@ class RPCDoneHandlerNoReq : public RPCAbstractDoneHandler { // done(req_id) using CallbackType = TReturn (*)(mtpRequestId); public: - RPCDoneHandlerNoReq(CallbackType onDone) : _onDone(onDone) { + RPCDoneHandlerNoReq(CallbackType onDone) : _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { (*_onDone)(requestId); @@ -346,7 +346,7 @@ class RPCDoneHandlerBareOwned : public RPCOwnedDoneHandler { // done(from, end) using CallbackType = bool (TReceiver::*)(const mtpPrime *, const mtpPrime *); public: - RPCDoneHandlerBareOwned(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerBareOwned(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return _owner @@ -364,7 +364,7 @@ class RPCDoneHandlerBareOwnedReq : public RPCOwnedDoneHandler { // done(from, en using CallbackType = bool (TReceiver::*)(const mtpPrime *, const mtpPrime *, mtpRequestId); public: - RPCDoneHandlerBareOwnedReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerBareOwnedReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return _owner @@ -382,7 +382,7 @@ class RPCDoneHandlerOwned : public RPCOwnedDoneHandler { // done(result) using CallbackType = TReturn (TReceiver::*)(const TResponse &); public: - RPCDoneHandlerOwned(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerOwned(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -405,7 +405,7 @@ class RPCDoneHandlerOwnedReq : public RPCOwnedDoneHandler { // done(result, req_ using CallbackType = TReturn (TReceiver::*)(const TResponse &, mtpRequestId); public: - RPCDoneHandlerOwnedReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerOwnedReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -428,7 +428,7 @@ class RPCDoneHandlerOwnedNo : public RPCOwnedDoneHandler { // done() using CallbackType = TReturn (TReceiver::*)(); public: - RPCDoneHandlerOwnedNo(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerOwnedNo(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { if (_owner) (static_cast(_owner)->*_onDone)(); @@ -445,7 +445,7 @@ class RPCDoneHandlerOwnedNoReq : public RPCOwnedDoneHandler { // done(req_id) using CallbackType = TReturn (TReceiver::*)(mtpRequestId); public: - RPCDoneHandlerOwnedNoReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { + RPCDoneHandlerOwnedNoReq(TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { if (_owner) (static_cast(_owner)->*_onDone)(requestId); @@ -462,7 +462,7 @@ class RPCBindedDoneHandlerBareOwned : public RPCOwnedDoneHandler { // done(b, fr using CallbackType = bool (TReceiver::*)(T, const mtpPrime *, const mtpPrime *); public: - RPCBindedDoneHandlerBareOwned(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { + RPCBindedDoneHandlerBareOwned(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return _owner @@ -481,7 +481,7 @@ class RPCBindedDoneHandlerBareOwnedReq : public RPCOwnedDoneHandler { // done(b, using CallbackType = bool (TReceiver::*)(T, const mtpPrime *, const mtpPrime *, mtpRequestId); public: - RPCBindedDoneHandlerBareOwnedReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { + RPCBindedDoneHandlerBareOwnedReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { return _owner @@ -500,7 +500,7 @@ class RPCBindedDoneHandlerOwned : public RPCOwnedDoneHandler { // done(b, result using CallbackType = TReturn (TReceiver::*)(T, const TResponse &); public: - RPCBindedDoneHandlerOwned(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone), _b(b) { + RPCBindedDoneHandlerOwned(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone), _b(b) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -524,7 +524,7 @@ class RPCBindedDoneHandlerOwnedReq : public RPCOwnedDoneHandler { // done(b, res using CallbackType = TReturn (TReceiver::*)(T, const TResponse &, mtpRequestId); public: - RPCBindedDoneHandlerOwnedReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone), _b(b) { + RPCBindedDoneHandlerOwnedReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _onDone(onDone), _b(b) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { auto response = TResponse(); @@ -548,7 +548,7 @@ class RPCBindedDoneHandlerOwnedNo : public RPCOwnedDoneHandler { // done(b) using CallbackType = TReturn (TReceiver::*)(T); public: - RPCBindedDoneHandlerOwnedNo(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { + RPCBindedDoneHandlerOwnedNo(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { if (_owner) (static_cast(_owner)->*_onDone)(_b); @@ -566,7 +566,7 @@ class RPCBindedDoneHandlerOwnedNoReq : public RPCOwnedDoneHandler { // done(b, r using CallbackType = TReturn (TReceiver::*)(T, mtpRequestId); public: - RPCBindedDoneHandlerOwnedNoReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { + RPCBindedDoneHandlerOwnedNoReq(T b, TReceiver *receiver, CallbackType onDone) : RPCOwnedDoneHandler(receiver), _b(b), _onDone(onDone) { } bool operator()(mtpRequestId requestId, const mtpPrime *from, const mtpPrime *end) override { if (_owner) (static_cast(_owner)->*_onDone)(_b, requestId); diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.cpp b/Telegram/SourceFiles/platform/linux/linux_libs.cpp index d60734e7c..fd628a20d 100644 --- a/Telegram/SourceFiles/platform/linux/linux_libs.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_libs.cpp @@ -17,19 +17,19 @@ namespace Libs { namespace { bool loadLibrary(QLibrary &lib, const char *name, int version) { - DEBUG_LOG(("Loading '%1' with version %2...").arg(QLatin1String(name)).arg(version)); - lib.setFileNameAndVersion(QLatin1String(name), version); - if (lib.load()) { - DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); - return true; - } - lib.setFileNameAndVersion(QLatin1String(name), QString()); - if (lib.load()) { - DEBUG_LOG(("Loaded '%1' without version!").arg(QLatin1String(name))); - return true; - } - LOG(("Could not load '%1' with version %2 :(").arg(QLatin1String(name)).arg(version)); - return false; + DEBUG_LOG(("Loading '%1' with version %2...").arg(QLatin1String(name)).arg(version)); + lib.setFileNameAndVersion(QLatin1String(name), version); + if (lib.load()) { + DEBUG_LOG(("Loaded '%1' with version %2!").arg(QLatin1String(name)).arg(version)); + return true; + } + lib.setFileNameAndVersion(QLatin1String(name), QString()); + if (lib.load()) { + DEBUG_LOG(("Loaded '%1' without version!").arg(QLatin1String(name))); + return true; + } + LOG(("Could not load '%1' with version %2 :(").arg(QLatin1String(name)).arg(version)); + return false; } #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h index 95426829e..769bea696 100644 --- a/Telegram/SourceFiles/platform/linux/linux_libs.h +++ b/Telegram/SourceFiles/platform/linux/linux_libs.h @@ -258,7 +258,7 @@ inline bool g_type_cit_helper(Object *instance, GType iface_type) { if (ginstance->g_class && ginstance->g_class->g_type == iface_type) { return true; } - return g_type_check_instance_is_a(ginstance, iface_type); + return g_type_check_instance_is_a(ginstance, iface_type); } typedef gint (*f_gtk_dialog_run)(GtkDialog *dialog); diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 42de1f947..0cc74d19a 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -188,12 +188,12 @@ static gboolean _trayIconCheck(gpointer/* pIn*/) { #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION quint32 djbStringHash(QString string) { - quint32 hash = 5381; - QByteArray chars = string.toLatin1(); - for(int i = 0; i < chars.length(); i++){ - hash = (hash << 5) + hash + chars[i]; - } - return hash; + quint32 hash = 5381; + QByteArray chars = string.toLatin1(); + for(int i = 0; i < chars.length(); i++){ + hash = (hash << 5) + hash + chars[i]; + } + return hash; } } // namespace @@ -556,7 +556,7 @@ void MainWindow::psFirstShow() { "telegramdesktop.desktop", "Telegram.desktop" }; - + for (auto it = possibleDesktopFiles.begin(); it != possibleDesktopFiles.end(); it++) { if (!QStandardPaths::locate(QStandardPaths::ApplicationsLocation, *it).isEmpty()) { _desktopFile = *it; diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index e4689994b..5a67acaca 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -39,13 +39,13 @@ using Platform::File::internal::EscapeShell; namespace { bool RunShellCommand(const QByteArray &command) { - auto result = system(command.constData()); - if (result) { - DEBUG_LOG(("App Error: command failed, code: %1, command (in utf8): %2").arg(result).arg(command.constData())); - return false; - } - DEBUG_LOG(("App Info: command succeeded, command (in utf8): %1").arg(command.constData())); - return true; + auto result = system(command.constData()); + if (result) { + DEBUG_LOG(("App Error: command failed, code: %1, command (in utf8): %2").arg(result).arg(command.constData())); + return false; + } + DEBUG_LOG(("App Info: command succeeded, command (in utf8): %1").arg(command.constData())); + return true; } void FallbackFontConfig() { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.h b/Telegram/SourceFiles/platform/linux/specific_linux.h index 7ebf43f7b..1aa1471da 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.h +++ b/Telegram/SourceFiles/platform/linux/specific_linux.h @@ -32,10 +32,10 @@ inline void IgnoreApplicationActivationRightNow() { } // namespace Platform inline QString psServerPrefix() { - return qsl("/tmp/"); + return qsl("/tmp/"); } inline void psCheckLocalSocket(const QString &serverName) { - QFile address(serverName); + QFile address(serverName); if (address.exists()) { address.remove(); } diff --git a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm index 0f1d4d79e..4758605c4 100644 --- a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm @@ -1163,7 +1163,7 @@ void AppendEmojiPacks(std::vector &to) { return item; } else if (isType(kTypeScrubber)) { const auto isSticker = ([dictionaryItem[@"cmd"] intValue] - == kCommandScrubberStickers); + == kCommandScrubberStickers); const auto type = isSticker ? ScrubberItemType::Sticker : ScrubberItemType::Emoji; diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.h b/Telegram/SourceFiles/platform/mac/specific_mac.h index 06645ba1c..38878770d 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.h +++ b/Telegram/SourceFiles/platform/mac/specific_mac.h @@ -33,13 +33,13 @@ inline void finish() { inline QString psServerPrefix() { #ifndef OS_MAC_STORE - return qsl("/tmp/"); + return qsl("/tmp/"); #else // OS_MAC_STORE return objc_documentsPath(); #endif // OS_MAC_STORE } inline void psCheckLocalSocket(const QString &serverName) { - QFile address(serverName); + QFile address(serverName); if (address.exists()) { address.remove(); } diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index 74cb0db1d..eaa230870 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -58,9 +58,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #endif #ifndef WM_NCPOINTERUPDATE -#define WM_NCPOINTERUPDATE 0x0241 -#define WM_NCPOINTERDOWN 0x0242 -#define WM_NCPOINTERUP 0x0243 +#define WM_NCPOINTERUPDATE 0x0241 +#define WM_NCPOINTERDOWN 0x0242 +#define WM_NCPOINTERUP 0x0243 #endif using namespace Microsoft::WRL; @@ -70,22 +70,23 @@ using namespace Windows::Foundation; using namespace Platform; namespace { - QStringList _initLogs; - bool themeInited = false; - bool finished = true; - QMargins simpleMargins, margins; - HICON bigIcon = 0, smallIcon = 0, overlayIcon = 0; +QStringList _initLogs; - class _PsInitializer { - public: - _PsInitializer() { - Dlls::start(); - } - }; - _PsInitializer _psInitializer; +bool themeInited = false; +bool finished = true; +QMargins simpleMargins, margins; +HICON bigIcon = 0, smallIcon = 0, overlayIcon = 0; +class _PsInitializer { +public: + _PsInitializer() { + Dlls::start(); + } }; +_PsInitializer _psInitializer; + +} // namespace void psDeleteDir(const QString &dir) { std::wstring wDir = QDir::toNativeSeparators(dir).toStdWString(); @@ -131,11 +132,11 @@ namespace { } QStringList psInitLogs() { - return _initLogs; + return _initLogs; } void psClearInitLogs() { - _initLogs = QStringList(); + _initLogs = QStringList(); } void psActivateProcess(uint64 pid) { diff --git a/Telegram/SourceFiles/settings/settings.style b/Telegram/SourceFiles/settings/settings.style index e28e5dc5b..9d1040125 100644 --- a/Telegram/SourceFiles/settings/settings.style +++ b/Telegram/SourceFiles/settings/settings.style @@ -197,12 +197,12 @@ autoDownloadLimitButton: SettingsButton(settingsButton) { padding: margins(22px, 10px, 22px, 0px); } settingsAudioVolumeSlider: MediaSlider(defaultContinuousSlider) { - seekSize: size(15px, 15px); + seekSize: size(15px, 15px); } settingsAudioVolumeSliderPadding: margins(23px, 5px, 20px, 10px); settingsAudioVolumeLabel: LabelSimple(defaultLabelSimple) { - font: boxTextFont; - textFg: windowBoldFg; + font: boxTextFont; + textFg: windowBoldFg; } settingsAudioVolumeLabelPadding: margins(22px, 11px, 22px, 11px); settingsLevelMeterPadding: margins(23px, 10px, 20px, 10px); diff --git a/Telegram/codegen b/Telegram/codegen index ee55a0b69..d14ae77ad 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit ee55a0b69f65622fe25487745e5537ebcffd8372 +Subproject commit d14ae77ad5ed27ca6ddbc9579c0c5e0afa18ffca diff --git a/Telegram/lib_base b/Telegram/lib_base index 78690f858..baae6cdd9 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 78690f858fc48b1bc824fd52a7d90a1080b0610e +Subproject commit baae6cdd9ba5216732222e7dec9a76b9ea3a7c83 diff --git a/Telegram/lib_rpl b/Telegram/lib_rpl index bd850834f..2888aabf2 160000 --- a/Telegram/lib_rpl +++ b/Telegram/lib_rpl @@ -1 +1 @@ -Subproject commit bd850834fc9ba6c62784306b65506ab19d64ab89 +Subproject commit 2888aabf28bf9ca89f3d6d67a523bc5f2ce802ce diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 765e52545..d30d36160 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 765e525458843ffb893586441b885ac5ba143e51 +Subproject commit d30d361609d4b76d3a55b1329642caee30b82264 diff --git a/cmake b/cmake index 449066752..b087501d6 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 449066752048a9b5e64f8b9bbad7af8b0e53e8b2 +Subproject commit b087501d66ea13395acd91397b3ab6a3a77c41b8