[wip] some todos and fixmes

This commit is contained in:
Berkus Decker 2017-11-27 19:18:44 +02:00
parent ee9afa4d8b
commit bb9e56514e
6 changed files with 9 additions and 3 deletions

View File

@ -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);

View File

@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
namespace base {
// @todo use ranges-v3 here
template <typename Range, typename Method>
decltype(auto) for_each(Range &&range, Method &&method) {
return std::for_each(

View File

@ -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;

View File

@ -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 <typename T>
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);
}

View File

@ -336,7 +336,7 @@ public:
_inGrab = true;
resizeEvent(0);
}
void grapWithoutTopBarShadow();
void grapWithoutTopBarShadow();//@fixme grab?
void grabFinish() override;
void rpcClear() override {
_inner->rpcClear();

View File

@ -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;