mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fix various warnings
This commit is contained in:
parent
30f51d8137
commit
641c5822d7
5 changed files with 13 additions and 12 deletions
|
@ -21,7 +21,7 @@
|
|||
#include <thread>
|
||||
|
||||
namespace chatterino {
|
||||
namespace {
|
||||
namespace detail {
|
||||
// Frames
|
||||
Frames::Frames()
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ namespace {
|
|||
}
|
||||
};
|
||||
}
|
||||
} // namespace
|
||||
} // namespace detail
|
||||
|
||||
// IMAGE2
|
||||
ImagePtr Image::fromUrl(const Url &url, qreal scale)
|
||||
|
@ -220,14 +220,14 @@ Image::Image(const Url &url, qreal scale)
|
|||
: url_(url)
|
||||
, scale_(scale)
|
||||
, shouldLoad_(true)
|
||||
, frames_(std::make_unique<Frames>())
|
||||
, frames_(std::make_unique<detail::Frames>())
|
||||
{
|
||||
}
|
||||
|
||||
Image::Image(const QPixmap &pixmap, qreal scale)
|
||||
: scale_(scale)
|
||||
, frames_(std::make_unique<Frames>(
|
||||
QVector<Frame<QPixmap>>{Frame<QPixmap>{pixmap, 1}}))
|
||||
, frames_(std::make_unique<detail::Frames>(
|
||||
QVector<detail::Frame<QPixmap>>{detail::Frame<QPixmap>{pixmap, 1}}))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -301,11 +301,11 @@ void Image::load()
|
|||
QBuffer buffer(const_cast<QByteArray *>(&data));
|
||||
buffer.open(QIODevice::ReadOnly);
|
||||
QImageReader reader(&buffer);
|
||||
auto parsed = readFrames(reader, that->url());
|
||||
auto parsed = detail::readFrames(reader, that->url());
|
||||
|
||||
postToThread(makeConvertCallback(parsed, [weak](auto frames) {
|
||||
if (auto shared = weak.lock())
|
||||
shared->frames_ = std::make_unique<Frames>(frames);
|
||||
shared->frames_ = std::make_unique<detail::Frames>(frames);
|
||||
}));
|
||||
|
||||
return Success;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "common/NullablePtr.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace {
|
||||
namespace detail {
|
||||
template <typename Image>
|
||||
struct Frame {
|
||||
Image image;
|
||||
|
@ -40,7 +40,7 @@ namespace {
|
|||
int durationOffset_{0};
|
||||
pajlada::Signals::Connection gifTimerConnection_;
|
||||
};
|
||||
} // namespace
|
||||
} // namespace detail
|
||||
|
||||
class Image;
|
||||
using ImagePtr = std::shared_ptr<Image>;
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
qreal scale_{1};
|
||||
bool empty_{false};
|
||||
bool shouldLoad_{false};
|
||||
std::unique_ptr<Frames> frames_{};
|
||||
std::unique_ptr<detail::Frames> frames_{};
|
||||
QObject object_{};
|
||||
};
|
||||
} // namespace chatterino
|
||||
|
|
|
@ -27,7 +27,6 @@ namespace chatterino {
|
|||
|
||||
MessageLayout::MessageLayout(MessagePtr message)
|
||||
: message_(message)
|
||||
, buffer_(nullptr)
|
||||
, container_(std::make_shared<MessageLayoutContainer>())
|
||||
{
|
||||
DebugCount::increase("message layout");
|
||||
|
|
|
@ -65,7 +65,7 @@ private:
|
|||
// variables
|
||||
MessagePtr message_;
|
||||
std::shared_ptr<MessageLayoutContainer> container_;
|
||||
std::shared_ptr<QPixmap> buffer_ = nullptr;
|
||||
std::shared_ptr<QPixmap> buffer_{};
|
||||
bool bufferValid_ = false;
|
||||
|
||||
int height_ = 0;
|
||||
|
|
|
@ -63,12 +63,14 @@ void Theme::actuallyUpdate(double hue, double multiplier)
|
|||
|
||||
/// WINDOW
|
||||
{
|
||||
/*
|
||||
QColor bg =
|
||||
#ifdef Q_OS_LINUX
|
||||
this->window.background = lightWin ? "#fff" : QColor(61, 60, 56);
|
||||
#else
|
||||
this->window.background = lightWin ? "#fff" : "#111";
|
||||
#endif
|
||||
*/
|
||||
|
||||
QColor fg = this->window.text = lightWin ? "#000" : "#eee";
|
||||
this->window.borderFocused = lightWin ? "#ccc" : themeColor;
|
||||
|
|
Loading…
Reference in a new issue