From bb9e56514e6bc465955fd766a2b12205d91899a3 Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Mon, 27 Nov 2017 19:18:44 +0200 Subject: [PATCH] [wip] some todos and fixmes --- Telegram/SourceFiles/application.cpp | 2 ++ Telegram/SourceFiles/base/algorithm.h | 1 + Telegram/SourceFiles/base/weak_unique_ptr.h | 2 ++ Telegram/SourceFiles/core/utils.h | 4 ++-- Telegram/SourceFiles/overviewwidget.h | 2 +- Telegram/ThirdParty/emoji_suggestions/emoji_suggestions.h | 1 + 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 2e27d5063..6ad6059fc 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -31,6 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org namespace { +// @todo are there no other ways to get/set hex? QChar _toHex(ushort v) { v = v & 0x000F; return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v)); @@ -39,6 +40,7 @@ ushort _fromHex(QChar c) { return ((c.unicode() >= uchar('a')) ? (c.unicode() - uchar('a') + 10) : (c.unicode() - uchar('0'))) & 0x000F; } +// @todo urlencode/decode functions might help here?? QString _escapeTo7bit(const QString &str) { QString result; result.reserve(str.size() * 2); diff --git a/Telegram/SourceFiles/base/algorithm.h b/Telegram/SourceFiles/base/algorithm.h index 44188b05e..e3aafda87 100644 --- a/Telegram/SourceFiles/base/algorithm.h +++ b/Telegram/SourceFiles/base/algorithm.h @@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org namespace base { +// @todo use ranges-v3 here template decltype(auto) for_each(Range &&range, Method &&method) { return std::for_each( diff --git a/Telegram/SourceFiles/base/weak_unique_ptr.h b/Telegram/SourceFiles/base/weak_unique_ptr.h index dd74f6d43..7ae74f12f 100644 --- a/Telegram/SourceFiles/base/weak_unique_ptr.h +++ b/Telegram/SourceFiles/base/weak_unique_ptr.h @@ -20,6 +20,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #pragma once +// @todo replace this with std::experimental::observer_ptr + namespace base { class enable_weak_from_this; diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 3c46326dd..8b1bbe45e 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -294,7 +294,7 @@ void finish(); } -using TimeMs = int64; +using TimeMs = int64; // @todo use std::chrono::milliseconds bool checkms(); // returns true if time has changed TimeMs getms(bool checked = false); @@ -418,7 +418,7 @@ inline QString fromUtf8Safe(const QByteArray &str) { static const QRegularExpression::PatternOptions reMultiline(QRegularExpression::DotMatchesEverythingOption | QRegularExpression::MultilineOption); template -inline T snap(const T &v, const T &_min, const T &_max) { +inline T snap(const T &v, const T &_min, const T &_max) { // @todo std::clamp() return (v < _min) ? _min : ((v > _max) ? _max : v); } diff --git a/Telegram/SourceFiles/overviewwidget.h b/Telegram/SourceFiles/overviewwidget.h index adde68249..0aaa9fe3e 100644 --- a/Telegram/SourceFiles/overviewwidget.h +++ b/Telegram/SourceFiles/overviewwidget.h @@ -336,7 +336,7 @@ public: _inGrab = true; resizeEvent(0); } - void grapWithoutTopBarShadow(); + void grapWithoutTopBarShadow();//@fixme grab? void grabFinish() override; void rpcClear() override { _inner->rpcClear(); diff --git a/Telegram/ThirdParty/emoji_suggestions/emoji_suggestions.h b/Telegram/ThirdParty/emoji_suggestions/emoji_suggestions.h index d99bd0d1c..2794cd4bb 100644 --- a/Telegram/ThirdParty/emoji_suggestions/emoji_suggestions.h +++ b/Telegram/ThirdParty/emoji_suggestions/emoji_suggestions.h @@ -31,6 +31,7 @@ using utf16char = unsigned short; static_assert(sizeof(utf16char) == 2, "Bad UTF-16 character size."); +// @todo kill this off, use std::u16string instead class utf16string { public: utf16string() = default;