fix various warnings

This commit is contained in:
Rasmus Karlsson 2018-09-20 13:09:37 +02:00
parent 30f51d8137
commit 641c5822d7
5 changed files with 13 additions and 12 deletions

View file

@ -21,7 +21,7 @@
#include <thread> #include <thread>
namespace chatterino { namespace chatterino {
namespace { namespace detail {
// Frames // Frames
Frames::Frames() Frames::Frames()
{ {
@ -179,7 +179,7 @@ namespace {
} }
}; };
} }
} // namespace } // namespace detail
// IMAGE2 // IMAGE2
ImagePtr Image::fromUrl(const Url &url, qreal scale) ImagePtr Image::fromUrl(const Url &url, qreal scale)
@ -220,14 +220,14 @@ Image::Image(const Url &url, qreal scale)
: url_(url) : url_(url)
, scale_(scale) , scale_(scale)
, shouldLoad_(true) , shouldLoad_(true)
, frames_(std::make_unique<Frames>()) , frames_(std::make_unique<detail::Frames>())
{ {
} }
Image::Image(const QPixmap &pixmap, qreal scale) Image::Image(const QPixmap &pixmap, qreal scale)
: scale_(scale) : scale_(scale)
, frames_(std::make_unique<Frames>( , frames_(std::make_unique<detail::Frames>(
QVector<Frame<QPixmap>>{Frame<QPixmap>{pixmap, 1}})) QVector<detail::Frame<QPixmap>>{detail::Frame<QPixmap>{pixmap, 1}}))
{ {
} }
@ -301,11 +301,11 @@ void Image::load()
QBuffer buffer(const_cast<QByteArray *>(&data)); QBuffer buffer(const_cast<QByteArray *>(&data));
buffer.open(QIODevice::ReadOnly); buffer.open(QIODevice::ReadOnly);
QImageReader reader(&buffer); QImageReader reader(&buffer);
auto parsed = readFrames(reader, that->url()); auto parsed = detail::readFrames(reader, that->url());
postToThread(makeConvertCallback(parsed, [weak](auto frames) { postToThread(makeConvertCallback(parsed, [weak](auto frames) {
if (auto shared = weak.lock()) if (auto shared = weak.lock())
shared->frames_ = std::make_unique<Frames>(frames); shared->frames_ = std::make_unique<detail::Frames>(frames);
})); }));
return Success; return Success;

View file

@ -16,7 +16,7 @@
#include "common/NullablePtr.hpp" #include "common/NullablePtr.hpp"
namespace chatterino { namespace chatterino {
namespace { namespace detail {
template <typename Image> template <typename Image>
struct Frame { struct Frame {
Image image; Image image;
@ -40,7 +40,7 @@ namespace {
int durationOffset_{0}; int durationOffset_{0};
pajlada::Signals::Connection gifTimerConnection_; pajlada::Signals::Connection gifTimerConnection_;
}; };
} // namespace } // namespace detail
class Image; class Image;
using ImagePtr = std::shared_ptr<Image>; using ImagePtr = std::shared_ptr<Image>;
@ -74,7 +74,7 @@ private:
qreal scale_{1}; qreal scale_{1};
bool empty_{false}; bool empty_{false};
bool shouldLoad_{false}; bool shouldLoad_{false};
std::unique_ptr<Frames> frames_{}; std::unique_ptr<detail::Frames> frames_{};
QObject object_{}; QObject object_{};
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -27,7 +27,6 @@ namespace chatterino {
MessageLayout::MessageLayout(MessagePtr message) MessageLayout::MessageLayout(MessagePtr message)
: message_(message) : message_(message)
, buffer_(nullptr)
, container_(std::make_shared<MessageLayoutContainer>()) , container_(std::make_shared<MessageLayoutContainer>())
{ {
DebugCount::increase("message layout"); DebugCount::increase("message layout");

View file

@ -65,7 +65,7 @@ private:
// variables // variables
MessagePtr message_; MessagePtr message_;
std::shared_ptr<MessageLayoutContainer> container_; std::shared_ptr<MessageLayoutContainer> container_;
std::shared_ptr<QPixmap> buffer_ = nullptr; std::shared_ptr<QPixmap> buffer_{};
bool bufferValid_ = false; bool bufferValid_ = false;
int height_ = 0; int height_ = 0;

View file

@ -63,12 +63,14 @@ void Theme::actuallyUpdate(double hue, double multiplier)
/// WINDOW /// WINDOW
{ {
/*
QColor bg = QColor bg =
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
this->window.background = lightWin ? "#fff" : QColor(61, 60, 56); this->window.background = lightWin ? "#fff" : QColor(61, 60, 56);
#else #else
this->window.background = lightWin ? "#fff" : "#111"; this->window.background = lightWin ? "#fff" : "#111";
#endif #endif
*/
QColor fg = this->window.text = lightWin ? "#000" : "#eee"; QColor fg = this->window.text = lightWin ? "#000" : "#eee";
this->window.borderFocused = lightWin ? "#ccc" : themeColor; this->window.borderFocused = lightWin ? "#ccc" : themeColor;