2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Closed beta 10019014: New input fields design and animations.

This commit is contained in:
John Preston
2016-12-09 21:56:01 +03:00
parent 2d48cde27a
commit 90234cb7a0
51 changed files with 1068 additions and 940 deletions

View File

@@ -424,11 +424,17 @@ public:
using return_type = typename lambda_type<Lambda>::return_type;
template <typename ...PointersAndLambda>
lambda_guard_data(PointersAndLambda&&... qobjectsAndLambda) : _lambda(init(_pointers, std_::forward<PointersAndLambda>(qobjectsAndLambda)...)) {
inline lambda_guard_data(PointersAndLambda&&... qobjectsAndLambda) : _lambda(init(_pointers, std_::forward<PointersAndLambda>(qobjectsAndLambda)...)) {
}
inline lambda_guard_data(const lambda_guard_data &other) : _lambda(other._lambda) {
for (auto i = 0; i != N; ++i) {
_pointers[i] = other._pointers[i];
}
}
template <typename ...Args>
inline return_type operator()(Args... args) const {
inline return_type operator()(Args&&... args) const {
for (int i = 0; i != N; ++i) {
if (!_pointers[i]) {
return return_type();
@@ -458,17 +464,44 @@ public:
using return_type = typename lambda_type<Lambda>::return_type;
template <typename ...PointersAndLambda>
lambda_guard(PointersAndLambda&&... qobjectsAndLambda) : _data(std_::make_unique<lambda_guard_data<N, Lambda>>(std_::forward<PointersAndLambda>(qobjectsAndLambda)...)) {
inline lambda_guard(PointersAndLambda&&... qobjectsAndLambda) : _data(std_::make_unique<lambda_guard_data<N, Lambda>>(std_::forward<PointersAndLambda>(qobjectsAndLambda)...)) {
static_assert(sizeof...(PointersAndLambda) == N + 1, "Wrong argument count!");
}
inline lambda_guard(const lambda_guard &&other) : _data(std_::move(other._data)) {
}
inline lambda_guard(lambda_guard &&other) : _data(std_::move(other._data)) {
}
inline lambda_guard &operator=(const lambda_guard &&other) {
_data = std_::move(other._data);
return *this;
}
inline lambda_guard &operator=(lambda_guard &&other) {
_data = std_::move(other._data);
return *this;
}
template <typename ...Args>
inline return_type operator()(Args... args) const {
inline return_type operator()(Args&&... args) const {
return (*_data)(std_::forward<Args>(args)...);
}
bool isNull() const {
return !_data;
}
lambda_guard clone() const {
return lambda_guard(*this);
}
private:
std_::unique_ptr<lambda_guard_data<N, Lambda>> _data;
inline lambda_guard(const lambda_guard &other) : _data(std_::make_unique<lambda_guard_data<N, Lambda>>(static_cast<const lambda_guard_data<N, Lambda> &>(*other._data))) {
}
mutable std_::unique_ptr<lambda_guard_data<N, Lambda>> _data;
};

View File

@@ -335,7 +335,8 @@ TimeMs getms(bool checked) {
return ((msCount - _msStart) * _msFreq) + (checked ? _msAddToMsStart : 0LL);
#else
timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
auto res = clock_gettime(CLOCK_MONOTONIC, &ts);
if (res != 0) {
LOG(("Bad clock_gettime result: %1").arg(res));
return 0;
}

View File

@@ -22,7 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "core/utils.h"
#define BETA_VERSION_MACRO (10019013ULL)
#define BETA_VERSION_MACRO (10019014ULL)
constexpr int AppVersion = 10020;
constexpr str_const AppVersionStr = "0.10.20";