refactor/reformat. remove useless common.h

This commit is contained in:
Rasmus Karlsson 2017-06-07 10:09:24 +02:00
parent b66dc479e6
commit 5b2b2e3e19
76 changed files with 148 additions and 264 deletions

View file

@ -96,7 +96,6 @@ HEADERS += \
src/asyncexec.h \ src/asyncexec.h \
src/channel.h \ src/channel.h \
src/colorscheme.h \ src/colorscheme.h \
src/common.h \
src/concurrentmap.h \ src/concurrentmap.h \
src/emojis.h \ src/emojis.h \
src/ircmanager.h \ src/ircmanager.h \

View file

@ -1,5 +1,4 @@
#ifndef ACCOUNTMANAGER_H #pragma once
#define ACCOUNTMANAGER_H
#include "twitch/twitchuser.h" #include "twitch/twitchuser.h"
@ -35,5 +34,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // ACCOUNTMANAGER_H

View file

@ -1,8 +1,7 @@
#ifndef APPDATAPATH_H #pragma once
#define APPDATAPATH_H
#include <QString> #include <QString>
#include <atomic>
#include <mutex> #include <mutex>
class Path class Path
@ -14,5 +13,3 @@ private:
static QString appdataPath; static QString appdataPath;
static std::mutex appdataPathMutex; static std::mutex appdataPathMutex;
}; };
#endif // APPDATAPATH_H

View file

@ -1,15 +1,16 @@
#ifndef ASYNCEXEC_H #pragma once
#define ASYNCEXEC_H
#include "qcoreapplication.h" #include <QCoreApplication>
#include <QRunnable> #include <QRunnable>
#include <QThreadPool> #include <QThreadPool>
#include <functional> #include <functional>
#define async_exec(a) QThreadPool::globalInstance()->start(new LambdaRunnable(a)); #define async_exec(a) QThreadPool::globalInstance()->start(new LambdaRunnable(a));
class LambdaRunnable : public QRunnable { class LambdaRunnable : public QRunnable
{
public: public:
LambdaRunnable(std::function<void()> action) LambdaRunnable(std::function<void()> action)
{ {
@ -24,5 +25,3 @@ public:
private: private:
std::function<void()> action; std::function<void()> action;
}; };
#endif // ASYNCEXEC_H

View file

@ -1,5 +1,4 @@
#ifndef CHANNEL_H #pragma once
#define CHANNEL_H
#include "concurrentmap.h" #include "concurrentmap.h"
#include "logging/loggingchannel.h" #include "logging/loggingchannel.h"
@ -11,6 +10,7 @@
#include <QString> #include <QString>
#include <QVector> #include <QVector>
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
#include <memory> #include <memory>
namespace chatterino { namespace chatterino {
@ -78,5 +78,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // CHANNEL_H

View file

@ -1,5 +1,4 @@
#ifndef CHANNELS_H #pragma once
#define CHANNELS_H
#include "channel.h" #include "channel.h"
@ -37,5 +36,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // CHANNELS_H

View file

@ -171,4 +171,5 @@ void ColorScheme::normalizeColor(QColor &color)
// color.setHslF(color.hueF(), s, newL); // color.setHslF(color.hueF(), s, newL);
} }
} // namespace chatterino } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef COLORSCHEME_H #pragma once
#define COLORSCHEME_H
#include <QBrush> #include <QBrush>
#include <QColor> #include <QColor>
@ -89,6 +88,5 @@ private:
void fillLookupTableValues(qreal (&array)[360], qreal from, qreal to, qreal fromValue, void fillLookupTableValues(qreal (&array)[360], qreal from, qreal to, qreal fromValue,
qreal toValue); qreal toValue);
}; };
}
#endif // COLORSCHEME_H } // namespace chatterino

View file

@ -1,17 +0,0 @@
#include <QString>
#ifndef COMMON_H
#define COMMON_H
#define STRINGISE_IMPL(x) #x
#define STRINGISE(x) STRINGISE_IMPL(x)
// Use: #pragma message WARN("My message")
#if _MSC_VER
#define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
#define WARN(exp) (FILE_LINE_LINK "WARNING: " exp)
#else //__GNUC__ - may need other defines for different compilers
#define WARN(exp) ("WARNING: " exp)
#endif
#endif // COMMON_H

View file

@ -1,5 +1,4 @@
#ifndef CONCURRENTMAP_H #pragma once
#define CONCURRENTMAP_H
#include <QMap> #include <QMap>
#include <QMutex> #include <QMutex>
@ -66,5 +65,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // CONCURRENTMAP_H

View file

@ -114,4 +114,5 @@ void Emojis::loadEmojis()
QMap<QString, QString>{{emoji.second.value, emoji.second.code}}); QMap<QString, QString>{{emoji.second.value, emoji.second.code}});
} }
} }
}
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef EMOJIS_H #pragma once
#define EMOJIS_H
#include "concurrentmap.h" #include "concurrentmap.h"
#include "messages/lazyloadedimage.h" #include "messages/lazyloadedimage.h"
@ -7,6 +6,7 @@
#include <QObject> #include <QObject>
#include <QRegularExpression> #include <QRegularExpression>
#include <QString> #include <QString>
#include <unordered_map> #include <unordered_map>
namespace chatterino { namespace chatterino {
@ -39,6 +39,5 @@ private:
{ {
} }
}; };
}
#endif // EMOJIS_H } // namespace chatterino

View file

@ -9,6 +9,7 @@
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkReply> #include <QNetworkReply>
#include <QNetworkRequest> #include <QNetworkRequest>
#include <memory> #include <memory>
#define TWITCH_EMOTE_TEMPLATE "https://static-cdn.jtvnw.net/emoticons/v1/{id}/{scale}.0" #define TWITCH_EMOTE_TEMPLATE "https://static-cdn.jtvnw.net/emoticons/v1/{id}/{scale}.0"

View file

@ -1,5 +1,4 @@
#ifndef EMOTES_H #pragma once
#define EMOTES_H
#define GIF_FRAME_LENGTH 33 #define GIF_FRAME_LENGTH 33
@ -94,5 +93,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // EMOTES_H

View file

@ -59,4 +59,5 @@ QFontMetrics &FontManager::getFontMetrics(Type type)
return *_metricsMedium; return *_metricsMedium;
} }
}
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef FONTS_H #pragma once
#define FONTS_H
#include <QFont> #include <QFont>
#include <QFontMetrics> #include <QFontMetrics>
@ -50,6 +49,5 @@ private:
int _generation; int _generation;
}; };
}
#endif // FONTS_H } // namespace chatterino

View file

@ -30,4 +30,5 @@ const QString &IrcUser2::getPassword() const
{ {
return _password; return _password;
} }
}
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef IRCUSER_H #pragma once
#define IRCUSER_H
#include <QString> #include <QString>
@ -24,5 +23,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // IRCUSER_H

View file

@ -217,7 +217,6 @@ void IrcManager::joinChannel(const QString &channelName)
this->connectionMutex.unlock(); this->connectionMutex.unlock();
} }
void IrcManager::partChannel(const QString &channelName) void IrcManager::partChannel(const QString &channelName)
{ {
this->connectionMutex.lock(); this->connectionMutex.lock();

View file

@ -1,5 +1,4 @@
#ifndef LOGGINGCHANNEL_H #pragma once
#define LOGGINGCHANNEL_H
#include "messages/message.h" #include "messages/message.h"
@ -35,5 +34,3 @@ private:
} // namespace logging } // namespace logging
} // namespace chatterino } // namespace chatterino
#endif // LOGGINGCHANNEL_H

View file

@ -1,5 +1,4 @@
#ifndef LOGGINGMANAGER_H #pragma once
#define LOGGINGMANAGER_H
#include "loggingchannel.h" #include "loggingchannel.h"
@ -13,5 +12,3 @@ std::shared_ptr<Channel> get(const QString &channelName);
} // namespace logging } // namespace logging
} // namespace chatterino } // namespace chatterino
#endif // LOGGINGMANAGER_H

View file

@ -1,6 +1,5 @@
#include "channelmanager.h" #include "channelmanager.h"
#include "colorscheme.h" #include "colorscheme.h"
#include "common.h"
#include "emojis.h" #include "emojis.h"
#include "emotemanager.h" #include "emotemanager.h"
#include "ircmanager.h" #include "ircmanager.h"

View file

@ -1,5 +1,4 @@
#ifndef LIMITEDQUEUE_H #pragma once
#define LIMITEDQUEUE_H
#include "messages/limitedqueuesnapshot.h" #include "messages/limitedqueuesnapshot.h"
@ -96,5 +95,3 @@ private:
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino
#endif // LIMITEDQUEUE_H

View file

@ -1,5 +1,4 @@
#ifndef LIMITEDQUEUESNAPSHOT_H #pragma once
#define LIMITEDQUEUESNAPSHOT_H
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -34,7 +33,6 @@ private:
int _offset; int _offset;
int _length; int _length;
}; };
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino
#endif // LIMITEDQUEUESNAPSHOT_H

View file

@ -14,5 +14,6 @@ Link::Link(Type type, const QString &value)
, value(value) , value(value)
{ {
} }
}
} } // namespace messages
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef LINK_H #pragma once
#define LINK_H
#include <QString> #include <QString>
@ -42,7 +41,6 @@ private:
Type type; Type type;
QString value; QString value;
}; };
}
}
#endif // LINK_H } // namespace messages
} // namespace chatterino

View file

@ -12,6 +12,7 @@
#include <QObjectUserData> #include <QObjectUserData>
#include <QStringList> #include <QStringList>
#include <ctime> #include <ctime>
#include <list> #include <list>
#include <tuple> #include <tuple>

View file

@ -1,5 +1,4 @@
#ifndef MESSAGE_H #pragma once
#define MESSAGE_H
#include "messages/message.h" #include "messages/message.h"
#include "messages/messageparseargs.h" #include "messages/messageparseargs.h"
@ -67,5 +66,3 @@ private:
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino
#endif // MESSAGE_H

View file

@ -1,5 +1,4 @@
#ifndef MESSAGEPARSEARGS_H #pragma once
#define MESSAGEPARSEARGS_H
namespace chatterino { namespace chatterino {
namespace messages { namespace messages {
@ -11,7 +10,6 @@ public:
bool isSentWhisper = false; bool isSentWhisper = false;
bool includeChannelName = false; bool includeChannelName = false;
}; };
}
}
#endif // MESSAGEPARSEARGS_H } // namespace messages
} // namespace chatterino

View file

@ -1,9 +1,9 @@
#ifndef MESSAGEREF_H #pragma once
#define MESSAGEREF_H
#include "messages/message.h" #include "messages/message.h"
#include <QPixmap> #include <QPixmap>
#include <memory> #include <memory>
namespace chatterino { namespace chatterino {
@ -50,5 +50,3 @@ private:
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino
#endif // MESSAGEREF_H

View file

@ -130,5 +130,6 @@ std::vector<short> &Word::getCharacterWidthCache() const
{ {
return _characterWidthCache; return _characterWidthCache;
} }
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef WORD_H #pragma once
#define WORD_H
#include "fontmanager.h" #include "fontmanager.h"
#include "messages/lazyloadedimage.h" #include "messages/lazyloadedimage.h"
@ -116,5 +115,3 @@ private:
} // namespace messages } // namespace messages
} // namespace chatterino } // namespace chatterino
#endif // WORD_H

View file

@ -102,5 +102,6 @@ int WordPart::getLineNumber()
{ {
return _lineNumber; return _lineNumber;
} }
}
} } // namespace messages
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef WORDPART_H #pragma once
#define WORDPART_H
#include <QRect> #include <QRect>
#include <QString> #include <QString>
@ -48,7 +47,6 @@ private:
bool _trailingSpace; bool _trailingSpace;
}; };
}
}
#endif // WORDPART_H } // namespace messages
} // namespace chatterino

View file

@ -56,4 +56,5 @@ void Resources::load()
Resources::buttonTimeout = Resources::buttonTimeout =
new messages::LazyLoadedImage(new QPixmap(":/images/button_timeout.png"), 0.25); new messages::LazyLoadedImage(new QPixmap(":/images/button_timeout.png"), 0.25);
} }
}
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef RESOURCES_H #pragma once
#define RESOURCES_H
#include "messages/lazyloadedimage.h" #include "messages/lazyloadedimage.h"
@ -108,6 +107,5 @@ private:
static messages::LazyLoadedImage *buttonBan; static messages::LazyLoadedImage *buttonBan;
static messages::LazyLoadedImage *buttonTimeout; static messages::LazyLoadedImage *buttonTimeout;
}; };
} // namespace chatterino
#endif // RESOURCES_H } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef SETTING_H #pragma once
#define SETTING_H
#include <QSettings> #include <QSettings>
#include <QString> #include <QString>
@ -73,5 +72,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // SETTING_H

View file

@ -1,5 +1,4 @@
#ifndef APPSETTINGS_H #pragma once
#define APPSETTINGS_H
#include "messages/word.h" #include "messages/word.h"
#include "setting.h" #include "setting.h"
@ -82,5 +81,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // APPSETTINGS_H

View file

@ -1,5 +1,4 @@
#ifndef SETTINGSSNAPSHOT_H #pragma once
#define SETTINGSSNAPSHOT_H
#include "setting.h" #include "setting.h"
@ -28,6 +27,5 @@ public:
private: private:
std::vector<std::pair<std::reference_wrapper<BaseSetting>, QVariant>> _items; std::vector<std::pair<std::reference_wrapper<BaseSetting>, QVariant>> _items;
}; };
} // namespace chatterino
#endif // SETTINGSSNAPSHOT_H } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef TWITCHEMOTEVALUE_H #pragma once
#define TWITCHEMOTEVALUE_H
#include "QString" #include "QString"
@ -28,7 +27,6 @@ private:
int _id; int _id;
QString _channelName; QString _channelName;
}; };
}
}
#endif // TWITCHEMOTEVALUE_H } // namespace twitch
} // namespace chatterino

View file

@ -9,6 +9,7 @@ using namespace chatterino::messages;
namespace chatterino { namespace chatterino {
namespace twitch { namespace twitch {
TwitchMessageBuilder::TwitchMessageBuilder() TwitchMessageBuilder::TwitchMessageBuilder()
: MessageBuilder() : MessageBuilder()
, messageId() , messageId()
@ -345,5 +346,6 @@ SharedMessage TwitchMessageBuilder::parse(const Communi::IrcPrivateMessage *ircM
//{ //{
// return a.first < b.first; // return a.first < b.first;
//} //}
}
} } // namespace twitch
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef TWITCHMESSAGEBUILDER_H #pragma once
#define TWITCHMESSAGEBUILDER_H
#include "channel.h" #include "channel.h"
#include "messages/messagebuilder.h" #include "messages/messagebuilder.h"
@ -26,6 +25,6 @@ public:
// const std::pair<long int, messages::LazyLoadedImage *> &a, // const std::pair<long int, messages::LazyLoadedImage *> &a,
// const std::pair<long int, messages::LazyLoadedImage *> &b); // const std::pair<long int, messages::LazyLoadedImage *> &b);
}; };
}
} } // namespace twitch
#endif // TWITCHMESSAGEBUILDER_H } // namespace chatterino

View file

@ -2,6 +2,7 @@
namespace chatterino { namespace chatterino {
namespace twitch { namespace twitch {
TwitchUser::TwitchUser(const QString &username, const QString &oauthToken, TwitchUser::TwitchUser(const QString &username, const QString &oauthToken,
const QString &oauthClient) const QString &oauthClient)
: IrcUser2(username, username, username, "oauth:" + oauthToken) : IrcUser2(username, username, username, "oauth:" + oauthToken)
@ -24,5 +25,6 @@ bool TwitchUser::isAnon() const
{ {
return IrcUser2::getNickName().startsWith("justinfan"); return IrcUser2::getNickName().startsWith("justinfan");
} }
}
} } // namespace twitch
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef ACCOUNT_H #pragma once
#define ACCOUNT_H
#include "ircaccount.h" #include "ircaccount.h"
@ -25,5 +24,3 @@ private:
} // namespace twitch } // namespace twitch
} // namespace chatterino } // namespace chatterino
#endif // ACCOUNT_H

View file

@ -1,5 +1,4 @@
#ifndef DISTANCEBETWEENPOINTS_H #pragma once
#define DISTANCEBETWEENPOINTS_H
#include <math.h> #include <math.h>
@ -16,7 +15,6 @@ static float distanceBetweenPoints(const QPointF &p1, const QPointF &p2)
return sqrt(distance); return sqrt(distance);
} }
}
}
#endif // DISTANCEBETWEENPOINTS_H } // namespace util
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef USERPOPUPWIDGET_H #pragma once
#define USERPOPUPWIDGET_H
#include <QWidget> #include <QWidget>
@ -31,5 +30,3 @@ private:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // USERPOPUPWIDGET_H

View file

@ -1,5 +1,4 @@
#ifndef CHATWIDGET_H #pragma once
#define CHATWIDGET_H
#include "channel.h" #include "channel.h"
#include "messages/limitedqueuesnapshot.h" #include "messages/limitedqueuesnapshot.h"
@ -65,5 +64,3 @@ public:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // CHATWIDGET_H

View file

@ -195,5 +195,6 @@ void ChatWidgetHeader::menuManualReconnect()
void ChatWidgetHeader::menuShowChangelog() void ChatWidgetHeader::menuShowChangelog()
{ {
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef CHATWIDGETHEADER_H #pragma once
#define CHATWIDGETHEADER_H
#include "signallabel.h" #include "signallabel.h"
#include "widgets/chatwidgetheaderbutton.h" #include "widgets/chatwidgetheaderbutton.h"
@ -39,7 +38,7 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *event); void mouseDoubleClickEvent(QMouseEvent *event);
private: private:
ChatWidget * const _chatWidget; ChatWidget *const _chatWidget;
QPoint _dragStart; QPoint _dragStart;
bool _dragging; bool _dragging;
@ -69,7 +68,6 @@ private slots:
void menuManualReconnect(); void menuManualReconnect();
void menuShowChangelog(); void menuShowChangelog();
}; };
}
}
#endif // CHATWIDGETHEADER_H } // namespace widgets
} // namespace chatterino

View file

@ -23,8 +23,7 @@ ChatWidgetHeaderButton::ChatWidgetHeaderButton(int spacing)
_hbox.addWidget(&_label); _hbox.addWidget(&_label);
_hbox.addSpacing(spacing); _hbox.addSpacing(spacing);
QObject::connect(&_label, &SignalLabel::mouseUp, this, QObject::connect(&_label, &SignalLabel::mouseUp, this, &ChatWidgetHeaderButton::labelMouseUp);
&ChatWidgetHeaderButton::labelMouseUp);
QObject::connect(&_label, &SignalLabel::mouseDown, this, QObject::connect(&_label, &SignalLabel::mouseDown, this,
&ChatWidgetHeaderButton::labelMouseDown); &ChatWidgetHeaderButton::labelMouseDown);
} }
@ -94,5 +93,6 @@ void ChatWidgetHeaderButton::labelMouseDown()
update(); update();
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef CHATWIDGETHEADERBUTTON_H #pragma once
#define CHATWIDGETHEADERBUTTON_H
#include "widgets/signallabel.h" #include "widgets/signallabel.h"
@ -45,7 +44,6 @@ private:
void labelMouseUp(); void labelMouseUp();
void labelMouseDown(); void labelMouseDown();
}; };
}
}
#endif // CHATWIDGETHEADERBUTTON_H } // namespace widgets
} // namespace chatterino

View file

@ -60,7 +60,7 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget)
completer->setWidget(&_edit); completer->setWidget(&_edit);
_edit.keyPressed.connect([this/*, completer*/](QKeyEvent *event) { _edit.keyPressed.connect([this /*, completer*/](QKeyEvent *event) {
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
auto c = _chatWidget->getChannel(); auto c = _chatWidget->getChannel();
if (c == nullptr) { if (c == nullptr) {
@ -137,5 +137,6 @@ void ChatWidgetInput::resizeEvent(QResizeEvent *)
_edit.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); _edit.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
} }
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef CHATWIDGETINPUT_H #pragma once
#define CHATWIDGETINPUT_H
#include "resizingtextedit.h" #include "resizingtextedit.h"
#include "widgets/chatwidgetheaderbutton.h" #include "widgets/chatwidgetheaderbutton.h"
@ -49,7 +48,6 @@ private slots:
void editTextChanged(); void editTextChanged();
// void editKeyPressed(QKeyEvent *event); // void editKeyPressed(QKeyEvent *event);
}; };
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // CHATWIDGETINPUT_H

View file

@ -137,5 +137,6 @@ void FancyButton::onMouseEffectTimeout()
update(); update();
} }
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef FANCYBUTTON_H #pragma once
#define FANCYBUTTON_H
#include <QMouseEvent> #include <QMouseEvent>
#include <QPainter> #include <QPainter>
@ -9,6 +8,7 @@
namespace chatterino { namespace chatterino {
namespace widgets { namespace widgets {
class FancyButton : public QWidget class FancyButton : public QWidget
{ {
struct ClickEffect { struct ClickEffect {
@ -49,7 +49,6 @@ private:
void onMouseEffectTimeout(); void onMouseEffectTimeout();
}; };
}
}
#endif // FANCYBUTTON_H } // namespace widgets
} // namespace chatterino

View file

@ -150,5 +150,6 @@ Notebook &MainWindow::getNotebook()
{ {
return _notebook; return _notebook;
} }
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef MAINWINDOW_H #pragma once
#define MAINWINDOW_H
#include "widgets/notebook.h" #include "widgets/notebook.h"
#include "widgets/titlebar.h" #include "widgets/titlebar.h"
@ -42,5 +41,3 @@ private:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // MAINWINDOW_H

View file

@ -1,5 +1,4 @@
#ifndef NOTEBOOK_H #pragma once
#define NOTEBOOK_H
#include "widgets/notebookbutton.h" #include "widgets/notebookbutton.h"
#include "widgets/notebookpage.h" #include "widgets/notebookpage.h"
@ -63,5 +62,3 @@ public:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // NOTEBOOK_H

View file

@ -102,5 +102,6 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
FancyButton::mouseReleaseEvent(event); FancyButton::mouseReleaseEvent(event);
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef NOTEBOOKBUTTON_H #pragma once
#define NOTEBOOKBUTTON_H
#include "fancybutton.h" #include "fancybutton.h"
@ -36,5 +35,3 @@ private:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // NOTEBOOKBUTTON_H

View file

@ -49,8 +49,7 @@ NotebookTab *NotebookPage::getTab() const
return _tab; return _tab;
} }
void void NotebookPage::addChat(bool openChannelNameDialog)
NotebookPage::addChat(bool openChannelNameDialog)
{ {
ChatWidget *w = new ChatWidget(); ChatWidget *w = new ChatWidget();

View file

@ -1,5 +1,4 @@
#ifndef NOTEBOOKPAGE_H #pragma once
#define NOTEBOOKPAGE_H
#include "widgets/chatwidget.h" #include "widgets/chatwidget.h"
#include "widgets/notebookpage.h" #include "widgets/notebookpage.h"
@ -82,5 +81,3 @@ public:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // NOTEBOOKPAGE_H

View file

@ -50,5 +50,6 @@ void NotebookPageDropPreview::setBounds(const QRect &rect)
animate = true; animate = true;
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef NOTEBOOKPAGEDROPPREVIEW_H #pragma once
#define NOTEBOOKPAGEDROPPREVIEW_H
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QWidget> #include <QWidget>
@ -23,7 +22,6 @@ protected:
QRect desiredGeometry; QRect desiredGeometry;
bool animate; bool animate;
}; };
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // NOTEBOOKPAGEDROPPREVIEW_H

View file

@ -1,5 +1,4 @@
#ifndef NOTEBOOKTAB_H #pragma once
#define NOTEBOOKTAB_H
#include <QPropertyAnimation> #include <QPropertyAnimation>
#include <QWidget> #include <QWidget>
@ -83,5 +82,3 @@ public:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // NOTEBOOKTAB_H

View file

@ -1,5 +1,4 @@
#ifndef RESIZINGTEXTEDIT_H #pragma once
#define RESIZINGTEXTEDIT_H
#include <QKeyEvent> #include <QKeyEvent>
#include <QTextEdit> #include <QTextEdit>
@ -50,5 +49,3 @@ protected:
} }
} }
}; };
#endif // RESIZINGTEXTEDIT_H

View file

@ -1,5 +1,4 @@
#ifndef SCROLLBARHIGHLIGHT_H #pragma once
#define SCROLLBARHIGHLIGHT_H
#include "QString" #include "QString"
@ -45,5 +44,3 @@ private:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // SCROLLBARHIGHLIGHT_H

View file

@ -1,5 +1,4 @@
#ifndef SETTINGSDIALOG_H #pragma once
#define SETTINGSDIALOG_H
#include "settingsmanager.h" #include "settingsmanager.h"
#include "settingssnapshot.h" #include "settingssnapshot.h"
@ -54,5 +53,3 @@ private:
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // SETTINGSDIALOG_H

View file

@ -71,5 +71,6 @@ void SettingsDialogTab::mousePressEvent(QMouseEvent *event)
_dialog->select(this); _dialog->select(this);
} }
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef SETTINGSNOTEBOOKTAB_H #pragma once
#define SETTINGSNOTEBOOKTAB_H
#include <QPaintEvent> #include <QPaintEvent>
#include <QWidget> #include <QWidget>
@ -37,7 +36,6 @@ private:
bool _selected; bool _selected;
}; };
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino
#endif // SETTINGSNOTEBOOKTAB_H

View file

@ -1,5 +1,4 @@
#ifndef SIGNALLABEL_H #pragma once
#define SIGNALLABEL_H
#include <QFlags> #include <QFlags>
#include <QLabel> #include <QLabel>
@ -52,5 +51,3 @@ protected:
event->ignore(); event->ignore();
} }
}; };
#endif // SIGNALLABEL_H

View file

@ -38,5 +38,6 @@ void TextInputDialog::cancelButtonClicked()
reject(); reject();
close(); close();
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef TEXTINPUTDIALOG_H #pragma once
#define TEXTINPUTDIALOG_H
#include <QDialog> #include <QDialog>
#include <QHBoxLayout> #include <QHBoxLayout>
@ -39,7 +38,6 @@ private slots:
void okButtonClicked(); void okButtonClicked();
void cancelButtonClicked(); void cancelButtonClicked();
}; };
}
}
#endif // TEXTINPUTDIALOG_H } // namespace widgets
} // namespace chatterino

View file

@ -2,10 +2,12 @@
namespace chatterino { namespace chatterino {
namespace widgets { namespace widgets {
TitleBar::TitleBar(QWidget *parent) TitleBar::TitleBar(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
setFixedHeight(32); setFixedHeight(32);
} }
}
} } // namespace widgets
} // namespace chatterino

View file

@ -1,16 +1,15 @@
#ifndef TITLEBAR_H #pragma once
#define TITLEBAR_H
#include <QWidget> #include <QWidget>
namespace chatterino { namespace chatterino {
namespace widgets { namespace widgets {
class TitleBar : public QWidget class TitleBar : public QWidget
{ {
public: public:
TitleBar(QWidget *parent = nullptr); TitleBar(QWidget *parent = nullptr);
}; };
}
}
#endif // TITLEBAR_H } // namespace widgets
} // namespace chatterino

View file

@ -1,5 +1,4 @@
#ifndef WINDOWS_H #pragma once
#define WINDOWS_H
#include "widgets/mainwindow.h" #include "widgets/mainwindow.h"
@ -35,5 +34,3 @@ private:
}; };
} // namespace chatterino } // namespace chatterino
#endif // WINDOWS_H