Switch some c-style includes to c++-style includes (i.e. stdint.h to
cstdint) Make MessageElement to a class to fit better with the derived classes. Make MessageLayoutElement to a class to fit better with the derived classes. Remove virtual from override functions Replace all instances of boost::signals2 with pajlada::Signals. This lets us properly use clang code model to check for issues. Add missing virtual destructor to AbstractIrcServer Add missing virtual destructor to MessageLayoutElement Remove unused "connectedConnection" connection in TwitchChannel Fix typo in TrimChannelName function Fix typo in MessageParseArgs Replace some raw pointers with unique pointers where it made more sense. This allowed us to remove some manually written destructors whose only purpose was to delete that raw pointer. Reformat: Add namespace comments Reformat: Add empty empty lines between main namespace beginning and end Reformat: Re-order includes Reformat: Fix some includes that used quotes where they should use angle brackets Reformat: Replace some typedef's with using's Filter out more useless warnings
This commit is contained in:
@@ -20,9 +20,9 @@
|
||||
#include <QGraphicsBlurEffect>
|
||||
#include <QPainter>
|
||||
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
@@ -461,7 +461,7 @@ void ChannelView::setSelection(const SelectionItem &start, const SelectionItem &
|
||||
// selections
|
||||
this->selection = Selection(start, end);
|
||||
|
||||
this->selectionChanged();
|
||||
this->selectionChanged.invoke();
|
||||
}
|
||||
|
||||
messages::MessageElement::Flags ChannelView::getFlags() const
|
||||
@@ -729,7 +729,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
|
||||
QPoint relativePos;
|
||||
int messageIndex;
|
||||
|
||||
this->mouseDown(event);
|
||||
this->mouseDown.invoke(event);
|
||||
|
||||
if (!tryGetMessageAt(event->pos(), layout, relativePos, messageIndex)) {
|
||||
setCursor(Qt::ArrowCursor);
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include <QTimer>
|
||||
#include <QWheelEvent>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace chatterino {
|
||||
@@ -28,7 +28,7 @@ class ChannelView : public BaseWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ChannelView(BaseWidget *parent = 0);
|
||||
explicit ChannelView(BaseWidget *parent = nullptr);
|
||||
virtual ~ChannelView();
|
||||
|
||||
void queueUpdate();
|
||||
@@ -49,26 +49,26 @@ public:
|
||||
|
||||
void clearMessages();
|
||||
|
||||
boost::signals2::signal<void(QMouseEvent *)> mouseDown;
|
||||
boost::signals2::signal<void()> selectionChanged;
|
||||
pajlada::Signals::Signal<QMouseEvent *> mouseDown;
|
||||
pajlada::Signals::NoArgSignal selectionChanged;
|
||||
pajlada::Signals::NoArgSignal highlightedMessageReceived;
|
||||
pajlada::Signals::Signal<const messages::Link &> linkClicked;
|
||||
|
||||
protected:
|
||||
virtual void themeRefreshEvent() override;
|
||||
void themeRefreshEvent() override;
|
||||
|
||||
virtual void resizeEvent(QResizeEvent *) override;
|
||||
void resizeEvent(QResizeEvent *) override;
|
||||
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
virtual void wheelEvent(QWheelEvent *event) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void wheelEvent(QWheelEvent *event) override;
|
||||
|
||||
virtual void enterEvent(QEvent *) override;
|
||||
virtual void leaveEvent(QEvent *) override;
|
||||
void enterEvent(QEvent *) override;
|
||||
void leaveEvent(QEvent *) override;
|
||||
|
||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
virtual void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
||||
|
||||
void handleLinkClick(QMouseEvent *event, const messages::Link &link,
|
||||
messages::MessageLayout *layout);
|
||||
@@ -116,12 +116,12 @@ private:
|
||||
|
||||
messages::LimitedQueue<messages::MessageLayoutPtr> messages;
|
||||
|
||||
boost::signals2::connection messageAppendedConnection;
|
||||
boost::signals2::connection messageAddedAtStartConnection;
|
||||
boost::signals2::connection messageRemovedConnection;
|
||||
boost::signals2::connection messageReplacedConnection;
|
||||
boost::signals2::connection repaintGifsConnection;
|
||||
boost::signals2::connection layoutConnection;
|
||||
pajlada::Signals::Connection messageAppendedConnection;
|
||||
pajlada::Signals::Connection messageAddedAtStartConnection;
|
||||
pajlada::Signals::Connection messageRemovedConnection;
|
||||
pajlada::Signals::Connection messageReplacedConnection;
|
||||
pajlada::Signals::Connection repaintGifsConnection;
|
||||
pajlada::Signals::Connection layoutConnection;
|
||||
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ public:
|
||||
void setBounds(const QRect &rect);
|
||||
|
||||
protected:
|
||||
virtual void paintEvent(QPaintEvent *) override;
|
||||
virtual void hideEvent(QHideEvent *) override;
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
void hideEvent(QHideEvent *) override;
|
||||
|
||||
QPropertyAnimation positionAnimation;
|
||||
QRect desiredGeometry;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
Label::Label(BaseWidget *parent)
|
||||
: BaseWidget(parent)
|
||||
{
|
||||
@@ -74,5 +75,6 @@ void Label::paintEvent(QPaintEvent *)
|
||||
|
||||
painter.drawText(this->rect(), flags, this->text);
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -29,5 +29,6 @@ private:
|
||||
QString text;
|
||||
FontStyle fontStyle = FontStyle::Medium;
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -144,5 +144,6 @@ void NotebookButton::dropEvent(QDropEvent *event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <QDebug>
|
||||
#include <QLinearGradient>
|
||||
#include <QPainter>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <pajlada/signals/connection.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class Notebook;
|
||||
|
||||
@@ -73,7 +73,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
|
||||
this->keyPressed(event);
|
||||
this->keyPressed.invoke(event);
|
||||
|
||||
if (event->key() == Qt::Key_Backtab) {
|
||||
// Ignore for now. We want to use it for autocomplete later
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QCompleter>
|
||||
#include <QKeyEvent>
|
||||
#include <QTextEdit>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/signals/signal.hpp>
|
||||
|
||||
class ResizingTextEdit : public QTextEdit
|
||||
{
|
||||
@@ -14,14 +14,14 @@ public:
|
||||
|
||||
bool hasHeightForWidth() const override;
|
||||
|
||||
boost::signals2::signal<void(QKeyEvent *)> keyPressed;
|
||||
pajlada::Signals::Signal<QKeyEvent *> keyPressed;
|
||||
|
||||
void setCompleter(QCompleter *c);
|
||||
QCompleter *getCompleter() const;
|
||||
|
||||
protected:
|
||||
virtual int heightForWidth(int) const override;
|
||||
virtual void keyPressEvent(QKeyEvent *event) override;
|
||||
int heightForWidth(int) const override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
QCompleter *completer = nullptr;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "QString"
|
||||
#include <QString>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
class ScrollbarHighlight
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "messages/limitedqueuesnapshot.hpp"
|
||||
#include "messages/message.hpp"
|
||||
#include "widgets/basewindow.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class Channel;
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class ChannelView;
|
||||
|
||||
class SearchPopup : public BaseWindow
|
||||
@@ -27,5 +31,6 @@ private:
|
||||
void initLayout();
|
||||
void performSearch();
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QPaintEvent>
|
||||
#include <QWidget>
|
||||
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
namespace settingspages {
|
||||
class SettingsPage;
|
||||
}
|
||||
} // namespace settingspages
|
||||
|
||||
class SettingsDialog;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace helper {
|
||||
SplitColumn::SplitColumn()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace helper
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "widgets/split.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace chatterino {
|
||||
namespace helper {
|
||||
|
||||
class SplitColumn
|
||||
{
|
||||
public:
|
||||
SplitColumn();
|
||||
SplitColumn() = default;
|
||||
|
||||
void insert(widgets::Split *split, int index = -1);
|
||||
void remove(int index);
|
||||
@@ -19,5 +20,6 @@ public:
|
||||
private:
|
||||
std::vector<widgets::Split> items;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace helper
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -57,7 +57,8 @@ SplitHeader::SplitHeader(Split *_split)
|
||||
title->setMouseTracking(true);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseDoubleClick, this,
|
||||
&SplitHeader::mouseDoubleClickEvent);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseMove, this, &SplitHeader::mouseMoveEvent);
|
||||
QObject::connect(this->titleLabel, &SignalLabel::mouseMove, this,
|
||||
&SplitHeader::mouseMoveEvent);
|
||||
|
||||
layout->addStretch(1);
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
#include <QPaintEvent>
|
||||
#include <QPoint>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2/connection.hpp>
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
namespace widgets {
|
||||
|
||||
class Split;
|
||||
@@ -50,7 +48,7 @@ private:
|
||||
QPoint dragStart;
|
||||
bool dragging = false;
|
||||
|
||||
boost::signals2::connection onlineStatusChangedConnection;
|
||||
pajlada::Signals::Connection onlineStatusChangedConnection;
|
||||
|
||||
RippleEffectButton *dropdownButton;
|
||||
// Label *titleLabel;
|
||||
|
||||
Reference in New Issue
Block a user