mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Fix a few conversions
This commit is contained in:
parent
4faeae5c73
commit
50bce25838
4 changed files with 10 additions and 8 deletions
|
@ -632,7 +632,8 @@ rainbowify(cmark_node *node)
|
|||
// get correct color for char index
|
||||
// Use colors as described here:
|
||||
// https://shark.comfsm.fm/~dleeling/cis/hsl_rainbow.html
|
||||
auto color = QColor::fromHslF((charIdx - 1.0) / textLen * (5. / 6.), 0.9, 0.5);
|
||||
auto color = QColor::fromHslF(
|
||||
static_cast<float>((charIdx - 1.0) / textLen * (5. / 6.)), 0.9f, 0.5f);
|
||||
// format color for HTML
|
||||
auto colorString = color.name(QColor::NameFormat::HexRgb);
|
||||
// create HTML element for current char
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "EventAccessors.h"
|
||||
#include "Logging.h"
|
||||
#include "MatrixClient.h"
|
||||
#include "Reaction.h"
|
||||
#include "UserSettingsPage.h"
|
||||
#include "Utils.h"
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <mtx/responses/messages.hpp>
|
||||
#include <mtx/responses/sync.hpp>
|
||||
|
||||
#include "Reaction.h"
|
||||
#include "encryption/Olm.h"
|
||||
|
||||
class EventStore final : public QObject
|
||||
|
@ -29,7 +28,7 @@ public:
|
|||
void refetchOnlineKeyBackupKeys();
|
||||
|
||||
// taken from QtPrivate::QHashCombine
|
||||
static uint hashCombine(uint hash, uint seed)
|
||||
static size_t hashCombine(uint hash, uint seed)
|
||||
{
|
||||
return seed ^ (hash + 0x9e3779b9 + (seed << 6) + (seed >> 2));
|
||||
};
|
||||
|
@ -38,9 +37,9 @@ public:
|
|||
std::string room;
|
||||
uint64_t idx;
|
||||
|
||||
friend uint qHash(const Index &i, uint seed = 0) noexcept
|
||||
friend size_t qHash(const Index &i, size_t seed = 0) noexcept
|
||||
{
|
||||
seed = hashCombine(qHashBits(i.room.data(), (int)i.room.size(), seed), seed);
|
||||
seed = hashCombine(qHashBits(i.room.data(), i.room.size(), seed), seed);
|
||||
seed = hashCombine(qHash(i.idx, seed), seed);
|
||||
return seed;
|
||||
}
|
||||
|
@ -54,10 +53,10 @@ public:
|
|||
{
|
||||
std::string room, id;
|
||||
|
||||
friend uint qHash(const IdIndex &i, uint seed = 0) noexcept
|
||||
friend size_t qHash(const IdIndex &i, size_t seed = 0) noexcept
|
||||
{
|
||||
seed = hashCombine(qHashBits(i.room.data(), (int)i.room.size(), seed), seed);
|
||||
seed = hashCombine(qHashBits(i.id.data(), (int)i.id.size(), seed), seed);
|
||||
seed = hashCombine(qHashBits(i.room.data(), i.room.size(), seed), seed);
|
||||
seed = hashCombine(qHashBits(i.id.data(), i.id.size(), seed), seed);
|
||||
return seed;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "EventStore.h"
|
||||
#include "InputBar.h"
|
||||
#include "Permissions.h"
|
||||
#include "Reaction.h"
|
||||
#include "ReadReceiptsModel.h"
|
||||
#include "ui/RoomSummary.h"
|
||||
|
||||
|
|
Loading…
Reference in a new issue