From 74d23137844ad43ba746a481373dc4daf5d003a8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 4 Nov 2020 18:50:17 +0300 Subject: [PATCH] Build Linux version with Qt 5.15.1 in CentOS 7 docker. --- Telegram/SourceFiles/apiwrap.cpp | 5 +- Telegram/SourceFiles/boxes/peer_list_box.cpp | 2 +- .../boxes/peers/edit_participant_box.cpp | 3 +- Telegram/SourceFiles/calls/calls_panel.cpp | 2 +- .../chat_helpers/emoji_suggestions_widget.cpp | 6 +- .../chat_helpers/stickers_list_widget.cpp | 4 +- Telegram/SourceFiles/core/application.cpp | 3 +- .../SourceFiles/core/crash_report_window.cpp | 10 +-- Telegram/SourceFiles/core/sandbox.cpp | 6 +- Telegram/SourceFiles/core/update_checker.cpp | 10 ++- .../SourceFiles/data/data_peer_values.cpp | 3 +- Telegram/SourceFiles/data/data_web_page.cpp | 3 +- .../export/view/export_view_settings.cpp | 3 +- .../history/history_item_components.cpp | 3 +- .../media/clip/media_clip_reader.h | 2 +- .../media/view/media_view_overlay_widget.cpp | 20 +++--- .../SourceFiles/media/view/media_view_pip.cpp | 4 +- .../mtproto/details/mtproto_tcp_socket.cpp | 6 +- .../mtproto/details/mtproto_tls_socket.cpp | 6 +- .../mtproto/mtproto_dc_options.cpp | 3 +- .../mtproto/special_config_request.cpp | 4 +- .../SourceFiles/overview/overview_layout.cpp | 3 +- .../platform/linux/file_utilities_linux.cpp | 4 +- .../platform/linux/file_utilities_linux.h | 2 +- .../linux/linux_desktop_environment.cpp | 3 +- .../platform/linux/specific_linux.cpp | 35 +++++---- .../platform/mac/file_utilities_mac.mm | 9 ++- .../platform/win/file_utilities_win.cpp | 6 +- .../platform/win/main_window_win.cpp | 2 +- .../profile/profile_block_peer_list.h | 2 +- .../SourceFiles/storage/file_download_web.cpp | 6 +- .../support/support_autocomplete.cpp | 3 +- Telegram/SourceFiles/ui/countryinput.cpp | 3 +- .../SourceFiles/ui/widgets/separate_panel.cpp | 1 - .../themes/window_theme_editor_block.cpp | 3 +- .../SourceFiles/window/window_title_qt.cpp | 2 +- Telegram/ThirdParty/fcitx-qt5 | 2 +- Telegram/build/build.sh | 72 ++----------------- Telegram/build/docker/build.sh | 17 ++++- Telegram/codegen | 2 +- Telegram/lib_base | 2 +- Telegram/lib_lottie | 2 +- Telegram/lib_qr | 2 +- Telegram/lib_spellcheck | 2 +- Telegram/lib_ui | 2 +- Telegram/lib_webrtc | 2 +- cmake | 2 +- 47 files changed, 131 insertions(+), 168 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index f97437270..d21aec624 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/application.h" #include "base/openssl_help.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include "base/call_delayed.h" #include "lang/lang_keys.h" #include "mainwindow.h" @@ -3277,7 +3278,7 @@ void ApiWrap::requestMessageAfterDate( // So we request a message with offset_date = desired_date - 1 and add_offset = -1. // This should give us the first message with date >= desired_date. auto offsetId = 0; - auto offsetDate = static_cast(QDateTime(date).toTime_t()) - 1; + auto offsetDate = static_cast(base::QDateToDateTime(date).toTime_t()) - 1; auto addOffset = -1; auto limit = 1; auto maxId = 0; @@ -3365,7 +3366,7 @@ void ApiWrap::jumpToHistoryDate(not_null peer, const QDate &date) { // const QDate &date, // Callback &&callback) { // const auto offsetId = 0; -// const auto offsetDate = static_cast(QDateTime(date).toTime_t()); +// const auto offsetDate = static_cast(base::QDateToDateTime(date).toTime_t()); // const auto addOffset = -2; // const auto limit = 1; // const auto hash = 0; diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index 9b8a5d51e..5a08ed6e7 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -178,7 +178,7 @@ void PeerListBox::resizeEvent(QResizeEvent *e) { void PeerListBox::paintEvent(QPaintEvent *e) { Painter p(this); - for (auto rect : e->region().rects()) { + for (const auto rect : e->region()) { p.fillRect(rect, st::contactsBg); } } diff --git a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp index ab18b9f87..c6fbac836 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp @@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_user.h" #include "core/core_cloud_password.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include "apiwrap.h" #include "main/main_session.h" #include "styles/style_layers.h" @@ -694,7 +695,7 @@ void EditRestrictedBox::showRestrictUntil() { highlighted, [this](const QDate &date) { setRestrictUntil( - static_cast(QDateTime(date).toTime_t())); + static_cast(base::QDateToDateTime(date).toTime_t())); }), Ui::LayerOption::KeepOther); _restrictUntilBox->setMaxDate( diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 10b1d6bd3..217924d13 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -981,7 +981,7 @@ void Panel::paint(QRect clip) { if (!_incoming->isHidden()) { region = region.subtracted(QRegion(_incoming->geometry())); } - for (const auto rect : region.rects()) { + for (const auto rect : region) { p.fillRect(rect, st::callBgOpaque); } if (_incoming && _incoming->isHidden()) { diff --git a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp index c3693d3b3..772d2e0ce 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_suggestions_widget.cpp @@ -171,10 +171,8 @@ bool SuggestionsWidget::eventHook(QEvent *e) { } void SuggestionsWidget::scrollByWheelEvent(not_null e) { - const auto horizontal = (e->angleDelta().x() != 0) - || (e->orientation() == Qt::Horizontal); - const auto vertical = (e->angleDelta().y() != 0) - || (e->orientation() == Qt::Vertical); + const auto horizontal = (e->angleDelta().x() != 0); + const auto vertical = (e->angleDelta().y() != 0); const auto current = scrollCurrent(); const auto scroll = [&] { if (horizontal) { diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index bece2cd01..d2534c7ed 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -614,8 +614,8 @@ bool StickersListWidget::Footer::eventHook(QEvent *e) { void StickersListWidget::Footer::scrollByWheelEvent( not_null e) { - auto horizontal = (e->angleDelta().x() != 0 || e->orientation() == Qt::Horizontal); - auto vertical = (e->angleDelta().y() != 0 || e->orientation() == Qt::Vertical); + auto horizontal = (e->angleDelta().x() != 0); + auto vertical = (e->angleDelta().y() != 0); if (horizontal) { _horizontal = true; } diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 74152204e..8058a0f32 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -79,6 +79,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include #include +#include namespace Core { namespace { @@ -941,7 +942,7 @@ QPoint Application::getPointForCallPanelCenter() const { if (const auto window = activeWindow()) { return window->getPointForCallPanelCenter(); } - return QApplication::desktop()->screenGeometry().center(); + return QGuiApplication::primaryScreen()->geometry().center(); } // macOS Qt bug workaround, sometimes no leaveEvent() gets to the nested widgets. diff --git a/Telegram/SourceFiles/core/crash_report_window.cpp b/Telegram/SourceFiles/core/crash_report_window.cpp index 4f69672b8..26277e331 100644 --- a/Telegram/SourceFiles/core/crash_report_window.cpp +++ b/Telegram/SourceFiles/core/crash_report_window.cpp @@ -39,7 +39,7 @@ PreLaunchWindow::PreLaunchWindow(QString title) { setWindowTitle(title.isEmpty() ? qsl("Telegram") : title); QPalette p(palette()); - p.setColor(QPalette::Background, QColor(255, 255, 255)); + p.setColor(QPalette::Window, QColor(255, 255, 255)); setPalette(p); QLabel tmp(this); @@ -79,7 +79,7 @@ PreLaunchLabel::PreLaunchLabel(QWidget *parent) : QLabel(parent) { setFont(labelFont); QPalette p(palette()); - p.setColor(QPalette::Foreground, QColor(0, 0, 0)); + p.setColor(QPalette::WindowText, QColor(0, 0, 0)); setPalette(p); show(); }; @@ -97,7 +97,7 @@ PreLaunchInput::PreLaunchInput(QWidget *parent, bool password) : QLineEdit(paren setFont(logFont); QPalette p(palette()); - p.setColor(QPalette::Foreground, QColor(0, 0, 0)); + p.setColor(QPalette::WindowText, QColor(0, 0, 0)); setPalette(p); QLineEdit::setTextMargins(0, 0, 0, 0); @@ -115,7 +115,7 @@ PreLaunchLog::PreLaunchLog(QWidget *parent) : QTextEdit(parent) { setFont(logFont); QPalette p(palette()); - p.setColor(QPalette::Foreground, QColor(96, 96, 96)); + p.setColor(QPalette::WindowText, QColor(96, 96, 96)); setPalette(p); setReadOnly(true); @@ -783,7 +783,7 @@ void LastCrashedWindow::updateControls() { } QRect scr(QApplication::primaryScreen()->availableGeometry()); - QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); + QSize s(2 * padding + QFontMetrics(_label.font()).horizontalAdvance(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); if (s == size()) { resizeEvent(0); } else { diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 3f6f47cb5..ecbe4d8f3 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -23,6 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/invoke_queued.h" #include "base/qthelp_url.h" #include "base/qthelp_regex.h" +#include "base/qt_adapters.h" #include "ui/effects/animations.h" #include "facades.h" #include "app.h" @@ -35,9 +36,6 @@ namespace { constexpr auto kEmptyPidForCommandResponse = 0ULL; -using ErrorSignal = void(QLocalSocket::*)(QLocalSocket::LocalSocketError); -const auto QLocalSocket_error = ErrorSignal(&QLocalSocket::error); - QChar _toHex(ushort v) { v = v & 0x000F; return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v)); @@ -112,7 +110,7 @@ int Sandbox::start() { [=] { socketDisconnected(); }); connect( &_localSocket, - QLocalSocket_error, + base::QLocalSocket_error, [=](QLocalSocket::LocalSocketError error) { socketError(error); }); connect( &_localSocket, diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index af4ceec77..79320c9e1 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "base/bytes.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include "storage/localstorage.h" #include "core/application.h" #include "core/changelogs.h" @@ -58,9 +59,6 @@ bool UpdaterIsDisabled = false; std::weak_ptr UpdaterInstance; -using ErrorSignal = void(QNetworkReply::*)(QNetworkReply::NetworkError); -const auto QNetworkReply_error = ErrorSignal(&QNetworkReply::error); - using Progress = UpdateChecker::Progress; using State = UpdateChecker::State; @@ -626,7 +624,7 @@ void HttpChecker::start() { _reply->connect(_reply, &QNetworkReply::finished, [=] { gotResponse(); }); - _reply->connect(_reply, QNetworkReply_error, [=](auto e) { + _reply->connect(_reply, base::QNetworkReply_error, [=](auto e) { gotFailure(e); }); } @@ -665,7 +663,7 @@ void HttpChecker::clearSentRequest() { return; } reply->disconnect(reply, &QNetworkReply::finished, nullptr, nullptr); - reply->disconnect(reply, QNetworkReply_error, nullptr, nullptr); + reply->disconnect(reply, base::QNetworkReply_error, nullptr, nullptr); reply->abort(); reply->deleteLater(); _manager = nullptr; @@ -819,7 +817,7 @@ void HttpLoaderActor::sendRequest() { &HttpLoaderActor::partFinished); connect( _reply.get(), - QNetworkReply_error, + base::QNetworkReply_error, this, &HttpLoaderActor::partFailed); connect( diff --git a/Telegram/SourceFiles/data/data_peer_values.cpp b/Telegram/SourceFiles/data/data_peer_values.cpp index 4074bd889..d0cf78fd0 100644 --- a/Telegram/SourceFiles/data/data_peer_values.cpp +++ b/Telegram/SourceFiles/data/data_peer_values.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_chat.h" #include "data/data_user.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" namespace Data { namespace { @@ -39,7 +40,7 @@ int OnlinePhraseChangeInSeconds(TimeId online, TimeId now) { return (hours + 1) * 3600 - (now - online); } const auto nowFull = base::unixtime::parse(now); - const auto tomorrow = QDateTime(nowFull.date().addDays(1)); + const auto tomorrow = base::QDateToDateTime(nowFull.date().addDays(1)); return std::max(static_cast(nowFull.secsTo(tomorrow)), 0); } diff --git a/Telegram/SourceFiles/data/data_web_page.cpp b/Telegram/SourceFiles/data/data_web_page.cpp index e08da3326..d0d5b895b 100644 --- a/Telegram/SourceFiles/data/data_web_page.cpp +++ b/Telegram/SourceFiles/data/data_web_page.cpp @@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_photo.h" #include "data/data_channel.h" #include "data/data_document.h" +#include "base/qt_adapters.h" #include "ui/image/image.h" #include "ui/text/text_entity.h" @@ -26,7 +27,7 @@ QString SiteNameFromUrl(const QString &url) { if (m.hasMatch()) pretty = pretty.mid(m.capturedLength()); int32 slash = pretty.indexOf('/'); if (slash > 0) pretty = pretty.mid(0, slash); - QStringList components = pretty.split('.', QString::SkipEmptyParts); + QStringList components = pretty.split('.', base::QStringSkipEmptyParts); if (components.size() >= 2) { components = components.mid(components.size() - 2); return components.at(0).at(0).toUpper() + components.at(0).mid(1) + '.' + components.at(1); diff --git a/Telegram/SourceFiles/export/view/export_view_settings.cpp b/Telegram/SourceFiles/export/view/export_view_settings.cpp index c06e8e38c..7fefa6639 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.cpp +++ b/Telegram/SourceFiles/export/view/export_view_settings.cpp @@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/file_utilities.h" #include "boxes/calendar_box.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include "main/main_session.h" #include "styles/style_widgets.h" #include "styles/style_export.h" @@ -478,7 +479,7 @@ void SettingsWidget::editDateLimit( })); }; const auto callback = crl::guard(this, [=](const QDate &date) { - done(base::unixtime::serialize(QDateTime(date))); + done(base::unixtime::serialize(base::QDateToDateTime(date))); if (const auto weak = shared->data()) { weak->closeBox(); } diff --git a/Telegram/SourceFiles/history/history_item_components.cpp b/Telegram/SourceFiles/history/history_item_components.cpp index 8a7f5e784..4215341c9 100644 --- a/Telegram/SourceFiles/history/history_item_components.cpp +++ b/Telegram/SourceFiles/history/history_item_components.cpp @@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_session.h" #include "window/window_session_controller.h" #include "facades.h" +#include "base/qt_adapters.h" #include "styles/style_widgets.h" #include "styles/style_chat.h" @@ -109,7 +110,7 @@ HiddenSenderInfo::HiddenSenderInfo(const QString &name) , colorPeerId(Data::FakePeerIdForJustName(name)) , userpic(Data::PeerUserpicColor(colorPeerId), name) { nameText.setText(st::msgNameStyle, name, Ui::NameTextOptions()); - const auto parts = name.trimmed().split(' ', QString::SkipEmptyParts); + const auto parts = name.trimmed().split(' ', base::QStringSkipEmptyParts); firstName = parts[0]; for (const auto &part : parts.mid(1)) { if (!lastName.isEmpty()) { diff --git a/Telegram/SourceFiles/media/clip/media_clip_reader.h b/Telegram/SourceFiles/media/clip/media_clip_reader.h index 9a86e68eb..b4ea5a3e9 100644 --- a/Telegram/SourceFiles/media/clip/media_clip_reader.h +++ b/Telegram/SourceFiles/media/clip/media_clip_reader.h @@ -226,7 +226,7 @@ public: ~Manager(); int loadLevel() const { - return _loadLevel.load(); + return _loadLevel; } void append(Reader *reader, const Core::FileLocation &location, const QByteArray &data); void start(Reader *reader); diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index e3ce5df7b..47c119cd4 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -2968,13 +2968,11 @@ void OverlayWidget::validatePhotoCurrentImage() { void OverlayWidget::paintEvent(QPaintEvent *e) { const auto r = e->rect(); - const auto ®ion = e->region(); - const auto rects = region.rects(); - + const auto region = e->region(); const auto contentShown = _photo || documentContentShown(); - const auto bgRects = contentShown - ? (region - contentRect()).rects() - : rects; + const auto bgRegion = contentShown + ? (region - contentRect()) + : region; auto ms = crl::now(); @@ -2988,7 +2986,7 @@ void OverlayWidget::paintEvent(QPaintEvent *e) { const auto m = p.compositionMode(); p.setCompositionMode(QPainter::CompositionMode_Source); const auto bgColor = _fullScreenVideo ? st::mediaviewVideoBg : st::mediaviewBg; - for (const auto &rect : bgRects) { + for (const auto rect : bgRegion) { p.fillRect(rect, bgColor); } p.setCompositionMode(m); @@ -3084,7 +3082,7 @@ void OverlayWidget::paintEvent(QPaintEvent *e) { auto o = overLevel(OverLeftNav); if (o > 0) { p.setOpacity(o * co); - for (const auto &rect : rects) { + for (const auto &rect : region) { const auto fill = _leftNav.intersected(rect); if (!fill.isEmpty()) p.fillRect(fill, st::mediaviewControlBg); } @@ -3100,7 +3098,7 @@ void OverlayWidget::paintEvent(QPaintEvent *e) { auto o = overLevel(OverRightNav); if (o > 0) { p.setOpacity(o * co); - for (const auto &rect : rects) { + for (const auto &rect : region) { const auto fill = _rightNav.intersected(rect); if (!fill.isEmpty()) p.fillRect(fill, st::mediaviewControlBg); } @@ -3116,7 +3114,7 @@ void OverlayWidget::paintEvent(QPaintEvent *e) { auto o = overLevel(OverClose); if (o > 0) { p.setOpacity(o * co); - for (const auto &rect : rects) { + for (const auto &rect : region) { const auto fill = _closeNav.intersected(rect); if (!fill.isEmpty()) p.fillRect(fill, st::mediaviewControlBg); } @@ -4151,7 +4149,7 @@ bool OverlayWidget::eventHook(QEvent *e) { } else { _accumScroll += ev->angleDelta(); if (ev->phase() == Qt::ScrollEnd) { - if (ev->orientation() == Qt::Horizontal) { + if (ev->angleDelta().x() != 0) { if (_accumScroll.x() * _accumScroll.x() > _accumScroll.y() * _accumScroll.y() && _accumScroll.x() != 0) { moveToNext(_accumScroll.x() > 0 ? -1 : 1); } diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index 6c2dadb3e..3059d8993 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -334,7 +334,7 @@ Qt::Edges RectPartToQtEdges(RectPart rectPart) { return Qt::BottomEdge; } - return 0; + return Qt::Edges(); } } // namespace @@ -591,7 +591,7 @@ void PipPanel::paintEvent(QPaintEvent *e) { QPainter p(this); if (_useTransparency) { - Ui::Platform::StartTranslucentPaint(p, e->region().rects()); + Ui::Platform::StartTranslucentPaint(p, e->region()); } auto request = FrameRequest(); diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp index 53680461a..aec382f3d 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_tcp_socket.cpp @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/details/mtproto_tcp_socket.h" #include "base/invoke_queued.h" +#include "base/qt_adapters.h" namespace MTP::details { @@ -33,12 +34,9 @@ TcpSocket::TcpSocket(not_null thread, const QNetworkProxy &proxy) &_socket, &QTcpSocket::readyRead, wrap([=] { _readyRead.fire({}); })); - - using ErrorSignal = void(QTcpSocket::*)(QAbstractSocket::SocketError); - const auto QTcpSocket_error = ErrorSignal(&QAbstractSocket::error); connect( &_socket, - QTcpSocket_error, + base::QTcpSocket_error, wrap([=](Error e) { handleError(e); })); } diff --git a/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp b/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp index b8cb2bb12..34030993a 100644 --- a/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp +++ b/Telegram/SourceFiles/mtproto/details/mtproto_tls_socket.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/bytes.h" #include "base/invoke_queued.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include #include @@ -470,12 +471,9 @@ TlsSocket::TlsSocket( &_socket, &QTcpSocket::readyRead, wrap([=] { plainReadyRead(); })); - - using ErrorSignal = void(QTcpSocket::*)(QAbstractSocket::SocketError); - const auto QTcpSocket_error = ErrorSignal(&QAbstractSocket::error); connect( &_socket, - QTcpSocket_error, + base::QTcpSocket_error, wrap([=](Error e) { handleError(e); })); } diff --git a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp index bb9211567..f232c2eb6 100644 --- a/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp +++ b/Telegram/SourceFiles/mtproto/mtproto_dc_options.cpp @@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/facade.h" #include "mtproto/connection_tcp.h" #include "storage/serialize_common.h" +#include "base/qt_adapters.h" #include #include @@ -779,7 +780,7 @@ bool DcOptions::loadFromFile(const QString &path) { stream.setCodec("UTF-8"); while (!stream.atEnd()) { auto line = stream.readLine(); - auto components = line.split(QRegularExpression(R"(\s)"), QString::SkipEmptyParts); + auto components = line.split(QRegularExpression(R"(\s)"), base::QStringSkipEmptyParts); if (components.isEmpty() || components[0].startsWith('#')) { continue; } diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp index 0d99e881c..f93c8539b 100644 --- a/Telegram/SourceFiles/mtproto/special_config_request.cpp +++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp @@ -79,9 +79,9 @@ bool CheckPhoneByPrefixesRules(const QString &phone, const QString &rules) { } QByteArray ConcatenateDnsTxtFields(const std::vector &response) { - auto entries = QMap(); + auto entries = QMultiMap(); for (const auto &entry : response) { - entries.insertMulti(INT_MAX - entry.data.size(), entry.data); + entries.insert(INT_MAX - entry.data.size(), entry.data); } return QStringList(entries.values()).join(QString()).toLatin1(); } diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 57d25bdf4..470d68f09 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item_components.h" #include "history/view/history_view_cursor_state.h" #include "base/unixtime.h" +#include "base/qt_adapters.h" #include "ui/effects/round_checkbox.h" #include "ui/image/image.h" #include "ui/text/format_values.h" @@ -1518,7 +1519,7 @@ Link::Link( domain = parts.at(2); } - parts = domain.split('@').back().split('.', QString::SkipEmptyParts); + parts = domain.split('@').back().split('.', base::QStringSkipEmptyParts); if (parts.size() > 1) { _letter = parts.at(parts.size() - 2).at(0).toUpper(); if (_title.isEmpty()) { diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index 552ed888a..41b68d79c 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "platform/linux/linux_desktop_environment.h" #include "platform/linux/specific_linux.h" #include "storage/localstorage.h" +#include "base/qt_adapters.h" #include @@ -387,7 +388,7 @@ QStringList cleanFilterList(const QString &filter) { int i = regexp.indexIn(f); if (i >= 0) f = regexp.cap(2); - return f.split(QLatin1Char(' '), QString::SkipEmptyParts); + return f.split(QLatin1Char(' '), base::QStringSkipEmptyParts); } } // namespace @@ -585,7 +586,6 @@ GtkFileChooserAction gtkFileChooserAction(QFileDialog::FileMode fileMode, QFileD else return GTK_FILE_CHOOSER_ACTION_SAVE; case QFileDialog::Directory: - case QFileDialog::DirectoryOnly: default: if (acceptMode == QFileDialog::AcceptOpen) return GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.h b/Telegram/SourceFiles/platform/linux/file_utilities_linux.h index 13fe85301..4b57d656e 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.h +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.h @@ -141,7 +141,7 @@ private: void hideHelper(); // Options - QFileDialog::Options _options = { 0 }; + QFileDialog::Options _options; QString _windowTitle = "Choose file"; QString _initialDirectory; QStringList _initialFiles; diff --git a/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp b/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp index 61f95452a..9a74925e0 100644 --- a/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "platform/linux/linux_desktop_environment.h" #include "platform/linux/specific_linux.h" +#include "base/qt_adapters.h" namespace Platform { namespace DesktopEnvironment { @@ -22,7 +23,7 @@ QString GetEnv(const char *name) { Type Compute() { auto xdgCurrentDesktop = GetEnv("XDG_CURRENT_DESKTOP").toLower(); - auto list = xdgCurrentDesktop.split(':', QString::SkipEmptyParts); + auto list = xdgCurrentDesktop.split(':', base::QStringSkipEmptyParts); auto desktopSession = GetEnv("DESKTOP_SESSION").toLower(); auto slash = desktopSession.lastIndexOf('/'); auto kdeSession = GetEnv("KDE_SESSION_VERSION"); diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index c1daf15d0..3a833dd78 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "platform/linux/linux_libs.h" #include "base/platform/base_platform_info.h" #include "base/platform/linux/base_xcb_utilities_linux.h" +#include "base/qt_adapters.h" #include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" @@ -248,14 +249,14 @@ bool GenerateDesktopFile( QRegularExpression::MultilineOption), qsl("TryExec=") + QFile::encodeName(cExeDir() + cExeName()) - .replace('\\', qsl("\\\\"))); + .replace('\\', "\\\\")); fileText = fileText.replace( QRegularExpression( qsl("^Exec=.*$"), QRegularExpression::MultilineOption), qsl("Exec=") + EscapeShell(QFile::encodeName(cExeDir() + cExeName())) - .replace('\\', qsl("\\\\")) + .replace('\\', "\\\\") + (args.isEmpty() ? QString() : ' ' + args)); } else { fileText = fileText.replace( @@ -1025,7 +1026,7 @@ namespace Platform { void start() { PlatformThemes = QString::fromUtf8(qgetenv("QT_QPA_PLATFORMTHEME")) - .split(':', QString::SkipEmptyParts); + .split(':', base::QStringSkipEmptyParts); LOG(("Launcher filename: %1").arg(GetLauncherFilename())); @@ -1249,27 +1250,35 @@ void OpenSystemSettingsForPermission(PermissionType type) { bool OpenSystemSettings(SystemSettingsType type) { if (type == SystemSettingsType::Audio) { - auto options = std::vector(); - const auto add = [&](const char *option) { - options.emplace_back(option); + struct Command { + QString command; + QStringList arguments; + }; + auto options = std::vector(); + const auto add = [&](const char *option, const char *arg = nullptr) { + auto command = Command{ .command = option }; + if (arg) { + command.arguments.push_back(arg); + } + options.push_back(std::move(command)); }; if (DesktopEnvironment::IsUnity()) { - add("unity-control-center sound"); + add("unity-control-center", "sound"); } else if (DesktopEnvironment::IsKDE()) { - add("kcmshell5 kcm_pulseaudio"); - add("kcmshell4 phonon"); + add("kcmshell5", "kcm_pulseaudio"); + add("kcmshell4", "phonon"); } else if (DesktopEnvironment::IsGnome()) { - add("gnome-control-center sound"); + add("gnome-control-center", "sound"); } else if (DesktopEnvironment::IsCinnamon()) { - add("cinnamon-settings sound"); + add("cinnamon-settings", "sound"); } else if (DesktopEnvironment::IsMATE()) { add("mate-volume-control"); } add("pavucontrol-qt"); add("pavucontrol"); add("alsamixergui"); - return ranges::any_of(options, [](const QString &command) { - return QProcess::startDetached(command); + return ranges::any_of(options, [](const Command &command) { + return QProcess::startDetached(command.command, command.arguments); }); } return true; diff --git a/Telegram/SourceFiles/platform/mac/file_utilities_mac.mm b/Telegram/SourceFiles/platform/mac/file_utilities_mac.mm index 59f7f7329..3d678abe4 100644 --- a/Telegram/SourceFiles/platform/mac/file_utilities_mac.mm +++ b/Telegram/SourceFiles/platform/mac/file_utilities_mac.mm @@ -9,10 +9,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/platform/mac/base_utilities_mac.h" #include "lang/lang_keys.h" +#include "base/qt_adapters.h" #include "styles/style_window.h" #include -#include +#include #include #include @@ -398,7 +399,11 @@ bool UnsafeShowOpenWithDropdown(const QString &filepath, QPoint menuPosition) { NSString *file = Q2NSString(filepath); @try { OpenFileWithInterface *menu = [[[OpenFileWithInterface alloc] init:file] autorelease]; - auto r = QApplication::desktop()->screenGeometry(menuPosition); + const auto screen = base::QScreenNearestTo(menuPosition); + if (!screen) { + return false; + } + const auto r = screen->availableGeometry(); auto x = menuPosition.x(); auto y = r.y() + r.height() - menuPosition.y(); return !![menu popupAtX:x andY:y]; diff --git a/Telegram/SourceFiles/platform/win/file_utilities_win.cpp b/Telegram/SourceFiles/platform/win/file_utilities_win.cpp index b515f8e65..6db8cffca 100644 --- a/Telegram/SourceFiles/platform/win/file_utilities_win.cpp +++ b/Telegram/SourceFiles/platform/win/file_utilities_win.cpp @@ -358,11 +358,7 @@ bool Get( dialog.setAcceptMode(QFileDialog::AcceptOpen); } else if (type == Type::ReadFolder) { // save dir dialog.setAcceptMode(QFileDialog::AcceptOpen); - - // We use "obsolete" value ::DirectoryOnly instead of ::Directory + ::ShowDirsOnly - // because in Windows XP native dialog this one works, while the "preferred" one - // shows a native file choose dialog where you can't choose a directory, only open one. - dialog.setFileMode(QFileDialog::DirectoryOnly); + dialog.setFileMode(QFileDialog::Directory); dialog.setOption(QFileDialog::ShowDirsOnly); } else { // save file dialog.setFileMode(QFileDialog::AnyFile); diff --git a/Telegram/SourceFiles/platform/win/main_window_win.cpp b/Telegram/SourceFiles/platform/win/main_window_win.cpp index 10d625363..63c43fe43 100644 --- a/Telegram/SourceFiles/platform/win/main_window_win.cpp +++ b/Telegram/SourceFiles/platform/win/main_window_win.cpp @@ -199,7 +199,7 @@ void MainWindow::psRefreshTaskbarIcon() { refresher->setWindowFlags(static_cast(Qt::Tool) | Qt::FramelessWindowHint); refresher->setGeometry(x() + 1, y() + 1, 1, 1); auto palette = refresher->palette(); - palette.setColor(QPalette::Background, (isActiveWindow() ? st::titleBgActive : st::titleBg)->c); + palette.setColor(QPalette::Window, (isActiveWindow() ? st::titleBgActive : st::titleBg)->c); refresher->setPalette(palette); refresher->show(); refresher->activateWindow(); diff --git a/Telegram/SourceFiles/profile/profile_block_peer_list.h b/Telegram/SourceFiles/profile/profile_block_peer_list.h index 7ead3ab7a..69231da3b 100644 --- a/Telegram/SourceFiles/profile/profile_block_peer_list.h +++ b/Telegram/SourceFiles/profile/profile_block_peer_list.h @@ -72,7 +72,7 @@ public: } template void sortItems(Predicate predicate) { - qSort(_items.begin(), _items.end(), std::move(predicate)); + std::sort(_items.begin(), _items.end(), std::move(predicate)); } void setPreloadMoreCallback(Fn callback) { diff --git a/Telegram/SourceFiles/storage/file_download_web.cpp b/Telegram/SourceFiles/storage/file_download_web.cpp index 73722eb50..3a963dc25 100644 --- a/Telegram/SourceFiles/storage/file_download_web.cpp +++ b/Telegram/SourceFiles/storage/file_download_web.cpp @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "storage/file_download_web.h" #include "storage/cache/storage_cache_types.h" +#include "base/qt_adapters.h" #include @@ -19,9 +20,6 @@ constexpr auto kResetDownloadPrioritiesTimeout = crl::time(200); std::weak_ptr GlobalLoadManager; -using ErrorSignal = void(QNetworkReply::*)(QNetworkReply::NetworkError); -const auto QNetworkReply_error = ErrorSignal(&QNetworkReply::error); - [[nodiscard]] std::shared_ptr GetManager() { auto result = GlobalLoadManager.lock(); if (!result) { @@ -270,7 +268,7 @@ not_null WebLoadManager::send(int id, const QString &url) { failed(id, result, error); }; connect(result, &QNetworkReply::downloadProgress, handleProgress); - connect(result, QNetworkReply_error, handleError); + connect(result, base::QNetworkReply_error, handleError); return result; } diff --git a/Telegram/SourceFiles/support/support_autocomplete.cpp b/Telegram/SourceFiles/support/support_autocomplete.cpp index 5222f63ff..e6b96c52c 100644 --- a/Telegram/SourceFiles/support/support_autocomplete.cpp +++ b/Telegram/SourceFiles/support/support_autocomplete.cpp @@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_session.h" #include "base/unixtime.h" #include "base/call_delayed.h" +#include "base/qt_adapters.h" #include "main/main_session.h" #include "main/main_session_settings.h" #include "apiwrap.h" @@ -484,7 +485,7 @@ void Autocomplete::submitValue(const QString &value) { const auto contact = value.mid( prefix.size(), (line > 0) ? (line - prefix.size()) : -1); - const auto parts = contact.split(' ', QString::SkipEmptyParts); + const auto parts = contact.split(' ', base::QStringSkipEmptyParts); if (parts.size() > 1) { const auto phone = parts[0]; const auto firstName = parts[1]; diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index b1bed7429..99ae478d8 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/multi_select.h" #include "ui/effects/ripple_animation.h" #include "data/data_countries.h" +#include "base/qt_adapters.h" #include "styles/style_layers.h" #include "styles/style_boxes.h" #include "styles/style_intro.h" @@ -248,7 +249,7 @@ CountrySelectBox::Inner::Inner(QWidget *parent, Type type) : QString()); const auto namesList = std::move(full).toLower().split( QRegularExpression("[\\s\\-]"), - QString::SkipEmptyParts); + base::QStringSkipEmptyParts); auto &names = _namesList.emplace_back(); names.reserve(namesList.size()); for (const auto &name : namesList) { diff --git a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp index dfd0478fd..d2caed510 100644 --- a/Telegram/SourceFiles/ui/widgets/separate_panel.cpp +++ b/Telegram/SourceFiles/ui/widgets/separate_panel.cpp @@ -358,7 +358,6 @@ void SeparatePanel::initGeometry(QSize size) { st::lineWidth, st::lineWidth); setAttribute(Qt::WA_OpaquePaintEvent, !_useTransparency); - const auto screen = QApplication::desktop()->screenGeometry(center); const auto rect = [&] { const QRect initRect(QPoint(), size); return initRect.translated(center - initRect.center()).marginsAdded(_padding); diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index 573cac4e5..59cfb29ec 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/edit_color_box.h" #include "lang/lang_keys.h" #include "base/call_delayed.h" +#include "base/qt_adapters.h" namespace Window { namespace Theme { @@ -154,7 +155,7 @@ void EditorBlock::Row::fillSearchIndex() { _searchWords.clear(); _searchStartChars.clear(); auto toIndex = _name + ' ' + _copyOf + ' ' + TextUtilities::RemoveAccents(_description.toString()) + ' ' + _valueString; - auto words = toIndex.toLower().split(SearchSplitter, QString::SkipEmptyParts); + auto words = toIndex.toLower().split(SearchSplitter, base::QStringSkipEmptyParts); for_const (auto &word, words) { _searchWords.insert(word); _searchStartChars.insert(word[0]); diff --git a/Telegram/SourceFiles/window/window_title_qt.cpp b/Telegram/SourceFiles/window/window_title_qt.cpp index 71cb2118a..fc210e1aa 100644 --- a/Telegram/SourceFiles/window/window_title_qt.cpp +++ b/Telegram/SourceFiles/window/window_title_qt.cpp @@ -393,7 +393,7 @@ Qt::Edges TitleWidgetQt::edgesFromPos(const QPoint &pos) { >= (window()->height() - getResizeArea(Qt::BottomEdge))) { return Qt::BottomEdge; } else { - return 0; + return Qt::Edges(); } } diff --git a/Telegram/ThirdParty/fcitx-qt5 b/Telegram/ThirdParty/fcitx-qt5 index 4abe66549..f95f76d63 160000 --- a/Telegram/ThirdParty/fcitx-qt5 +++ b/Telegram/ThirdParty/fcitx-qt5 @@ -1 +1 @@ -Subproject commit 4abe66549e13b33fd4baa84858d932e0178ce8c0 +Subproject commit f95f76d637990f66f056eb099d46e3b5e6e7366f diff --git a/Telegram/build/build.sh b/Telegram/build/build.sh index 8e8cd5c05..5d9b64514 100755 --- a/Telegram/build/build.sh +++ b/Telegram/build/build.sh @@ -134,73 +134,13 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ]; then Error "Backup folder not found!" fi - ./configure.sh + ./build/docker/centos_env/run.sh /usr/src/tdesktop/Telegram/build/docker/build.sh - cd $ProjectPath - cmake --build . --config Release --target Telegram -- -j8 - cd $ReleasePath - - echo "$BinaryName build complete!" - - if [ ! -f "$ReleasePath/$BinaryName" ]; then - Error "$BinaryName not found!" - fi - - # BadCount=`objdump -T $ReleasePath/$BinaryName | grep GLIBC_2\.1[6-9] | wc -l` - # if [ "$BadCount" != "0" ]; then - # Error "Bad GLIBC usages found: $BadCount" - # fi - - # BadCount=`objdump -T $ReleasePath/$BinaryName | grep GLIBC_2\.2[0-9] | wc -l` - # if [ "$BadCount" != "0" ]; then - # Error "Bad GLIBC usages found: $BadCount" - # fi - - BadCount=`objdump -T $ReleasePath/$BinaryName | grep GCC_4\.[3-9] | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GCC usages found: $BadCount" - fi - - BadCount=`objdump -T $ReleasePath/$BinaryName | grep GCC_[5-9]\. | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GCC usages found: $BadCount" - fi - - if [ ! -f "$ReleasePath/Updater" ]; then - Error "Updater not found!" - fi - - BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.1[6-9] | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GLIBC usages found: $BadCount" - fi - - BadCount=`objdump -T $ReleasePath/Updater | grep GLIBC_2\.2[0-9] | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GLIBC usages found: $BadCount" - fi - - BadCount=`objdump -T $ReleasePath/Updater | grep GCC_4\.[3-9] | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GCC usages found: $BadCount" - fi - - BadCount=`objdump -T $ReleasePath/Updater | grep GCC_[5-9]\. | wc -l` - if [ "$BadCount" != "0" ]; then - Error "Bad GCC usages found: $BadCount" - fi - - echo "Dumping debug symbols.." - "$HomePath/../../Libraries/breakpad/out/Default/dump_syms" "$ReleasePath/$BinaryName" > "$ReleasePath/$BinaryName.sym" - echo "Done!" - - echo "Stripping the executable.." - strip -s "$ReleasePath/$BinaryName" - echo "Done!" - - echo "Removing RPATH.." - chrpath -d "$ReleasePath/$BinaryName" - echo "Done!" + echo "Copying from docker result folder." + cp "$ReleasePath/root/$BinaryName" "$ReleasePath/$BinaryName" + cp "$ReleasePath/root/$BinaryName.sym" "$ReleasePath/$BinaryName.sym" + cp "$ReleasePath/root/Updater" "$ReleasePath/Updater" + cp "$ReleasePath/root/Packer" "$ReleasePath/Packer" echo "Preparing version $AppVersionStrFull, executing Packer.." cd "$ReleasePath" diff --git a/Telegram/build/docker/build.sh b/Telegram/build/docker/build.sh index 4745a07bd..c9415e2f8 100755 --- a/Telegram/build/docker/build.sh +++ b/Telegram/build/docker/build.sh @@ -1,10 +1,25 @@ #!/bin/bash +set -e +FullExecPath=$PWD +pushd `dirname $0` > /dev/null +FullScriptPath=`pwd` +popd > /dev/null + +if [ ! -d "$FullScriptPath/../../../../DesktopPrivate" ]; then + echo "" + echo "This script is for building the production version of Telegram Desktop." + echo "" + echo "For building custom versions please visit the build instructions page at:" + echo "https://github.com/telegramdesktop/tdesktop/#build-instructions" + exit +fi + Run () { scl enable devtoolset-8 -- "$@" } -HomePath=/usr/src/tdesktop/Telegram +HomePath="$FullScriptPath/../.." cd $HomePath ProjectPath="$HomePath/../out" diff --git a/Telegram/codegen b/Telegram/codegen index 8b4686f24..127968de8 160000 --- a/Telegram/codegen +++ b/Telegram/codegen @@ -1 +1 @@ -Subproject commit 8b4686f24d80f1f8d6a4ad0d6a55bf1bb701f35a +Subproject commit 127968de8129e8ccfa6ac50721c70415a5a087c3 diff --git a/Telegram/lib_base b/Telegram/lib_base index ffe7a4681..03b7b4cd6 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit ffe7a4681ab4b11353c62c36d010db96f0f90fd8 +Subproject commit 03b7b4cd6f26ff53dff311438bf9c3f84dec13aa diff --git a/Telegram/lib_lottie b/Telegram/lib_lottie index b83eed168..fb40f379d 160000 --- a/Telegram/lib_lottie +++ b/Telegram/lib_lottie @@ -1 +1 @@ -Subproject commit b83eed16812f4de3c2537cd12722d3dece95021b +Subproject commit fb40f379d82ffa1fc7506e9a8dddcf48847715ae diff --git a/Telegram/lib_qr b/Telegram/lib_qr index 9877397db..92ce41a69 160000 --- a/Telegram/lib_qr +++ b/Telegram/lib_qr @@ -1 +1 @@ -Subproject commit 9877397dbf97b7198d539a3994bf0e9619cf653c +Subproject commit 92ce41a690a463eb462089a4eb1e51e019308018 diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 053e44a10..8aede3acc 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 053e44a10107de4a0b7e9ad8826150c577db2a2b +Subproject commit 8aede3acc9d386484d2774316e9d1a3d0c265dd5 diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 9c9a4bc4d..d4c99701b 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 9c9a4bc4d85d7d771e6ff1084fe2ffe2cc883941 +Subproject commit d4c99701b5210a2db83b1c0f13da1a62f48dfb80 diff --git a/Telegram/lib_webrtc b/Telegram/lib_webrtc index d7c4f1f0b..52d52cad4 160000 --- a/Telegram/lib_webrtc +++ b/Telegram/lib_webrtc @@ -1 +1 @@ -Subproject commit d7c4f1f0b902158f065ea9fb6b7ec80fa0ceac45 +Subproject commit 52d52cad4e554dac1907224372d51fd40b9da92f diff --git a/cmake b/cmake index 94025be39..3a2d8a252 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 94025be392ab7e58115ac376cbf449cdca10de22 +Subproject commit 3a2d8a252d7e84547b532605aaa557a8c70d6d0f