From 747cafb4fd90b452fdc53274b92b1c4cea6580f4 Mon Sep 17 00:00:00 2001 From: leha-bot Date: Wed, 17 Oct 2018 23:08:37 +0300 Subject: [PATCH 1/2] Use {appname} for splash screen string --- Telegram/Resources/langs/lang.strings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 6fa43faed..ab6751259 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -165,7 +165,7 @@ "lng_pinned_unpin" = "Unpin"; "lng_pinned_notify" = "Notify all members"; -"lng_intro_about" = "Welcome to Kepka - the unofficial telegram app.\nIt's fast and secure."; +"lng_intro_about" = "Welcome to the {appname}, unofficial Telegram app.\nIt's fast and secure."; "lng_start_msgs" = "START MESSAGING"; "lng_intro_next" = "NEXT"; From f47af14a3606737ae7a88fa830e937d97cbf67a0 Mon Sep 17 00:00:00 2001 From: crackedmind Date: Mon, 29 Oct 2018 12:44:02 +0300 Subject: [PATCH 2/2] Remove unused code --- .../SourceFiles/history/history_widget.cpp | 91 ------------------- 1 file changed, 91 deletions(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 08c40ac4e..58b493595 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -61,7 +61,6 @@ #include "styles/style_chat_helpers.h" #include "styles/style_dialogs.h" #include "styles/style_history.h" -#include "styles/style_profile.h" #include "styles/style_window.h" #include "ui/effects/ripple_animation.h" #include "ui/special_buttons.h" @@ -75,96 +74,6 @@ #include "window/themes/window_theme.h" #include "window/top_bar_widget.h" #include "window/window_controller.h" -#include -// Smart pointer for QObject*, has move semantics, destroys object if it doesn't have a parent. -template class test_ptr { -public: - test_ptr(std::nullptr_t) {} - - // No default constructor, but constructors with at least - // one argument are simply make functions. - template - explicit test_ptr(Parent &&parent, Args &&... args) - : _object(new Object(std::forward(parent), std::forward(args)...)) {} - - test_ptr(const test_ptr &other) = delete; - test_ptr &operator=(const test_ptr &other) = delete; - test_ptr(test_ptr &&other) - : _object(base::take(other._object)) {} - test_ptr &operator=(test_ptr &&other) { - auto temp = std::move(other); - destroy(); - std::swap(_object, temp._object); - return *this; - } - - template ::value>> - test_ptr(test_ptr &&other) - : _object(base::take(other._object)) {} - - template ::value>> - test_ptr &operator=(test_ptr &&other) { - _object = base::take(other._object); - return *this; - } - - test_ptr &operator=(std::nullptr_t) { - _object = nullptr; - return *this; - } - - // So we can pass this pointer to methods like connect(). - Object *data() const { - return static_cast(_object); - } - operator Object *() const { - return data(); - } - - explicit operator bool() const { - return _object != nullptr; - } - - Object *operator->() const { - return data(); - } - Object &operator*() const { - return *data(); - } - - // Use that instead "= new Object(parent, ...)" - template void create(Parent &&parent, Args &&... args) { - destroy(); - _object = new Object(std::forward(parent), std::forward(args)...); - } - void destroy() { - delete base::take(_object); - } - void destroyDelayed() { - if (_object) { - if (auto widget = base::up_cast(data())) { - widget->hide(); - } - base::take(_object)->deleteLater(); - } - } - - ~test_ptr() { - if (auto pointer = _object) { - if (!pointer->parent()) { - destroy(); - } - } - } - -private: - template friend class test_ptr; - - QPointer _object; -}; - -class TestClass; -test_ptr tmp = {nullptr}; namespace {