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
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef USERPOPUPWIDGET_H
#define USERPOPUPWIDGET_H
#pragma once
#include <QWidget>
@@ -31,5 +30,3 @@ private:
} // namespace widgets
} // namespace chatterino
#endif // USERPOPUPWIDGET_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef CHATWIDGET_H
#define CHATWIDGET_H
#pragma once
#include "channel.h"
#include "messages/limitedqueuesnapshot.h"
@@ -65,5 +64,3 @@ public:
} // namespace widgets
} // namespace chatterino
#endif // CHATWIDGET_H
+3 -2
View File
@@ -195,5 +195,6 @@ void ChatWidgetHeader::menuManualReconnect()
void ChatWidgetHeader::menuShowChangelog()
{
}
}
}
} // namespace widgets
} // namespace chatterino
+4 -6
View File
@@ -1,5 +1,4 @@
#ifndef CHATWIDGETHEADER_H
#define CHATWIDGETHEADER_H
#pragma once
#include "signallabel.h"
#include "widgets/chatwidgetheaderbutton.h"
@@ -39,7 +38,7 @@ protected:
void mouseDoubleClickEvent(QMouseEvent *event);
private:
ChatWidget * const _chatWidget;
ChatWidget *const _chatWidget;
QPoint _dragStart;
bool _dragging;
@@ -69,7 +68,6 @@ private slots:
void menuManualReconnect();
void menuShowChangelog();
};
}
}
#endif // CHATWIDGETHEADER_H
} // namespace widgets
} // namespace chatterino
+4 -4
View File
@@ -23,8 +23,7 @@ ChatWidgetHeaderButton::ChatWidgetHeaderButton(int spacing)
_hbox.addWidget(&_label);
_hbox.addSpacing(spacing);
QObject::connect(&_label, &SignalLabel::mouseUp, this,
&ChatWidgetHeaderButton::labelMouseUp);
QObject::connect(&_label, &SignalLabel::mouseUp, this, &ChatWidgetHeaderButton::labelMouseUp);
QObject::connect(&_label, &SignalLabel::mouseDown, this,
&ChatWidgetHeaderButton::labelMouseDown);
}
@@ -94,5 +93,6 @@ void ChatWidgetHeaderButton::labelMouseDown()
update();
}
}
}
} // namespace widgets
} // namespace chatterino
+3 -5
View File
@@ -1,5 +1,4 @@
#ifndef CHATWIDGETHEADERBUTTON_H
#define CHATWIDGETHEADERBUTTON_H
#pragma once
#include "widgets/signallabel.h"
@@ -45,7 +44,6 @@ private:
void labelMouseUp();
void labelMouseDown();
};
}
}
#endif // CHATWIDGETHEADERBUTTON_H
} // namespace widgets
} // namespace chatterino
+4 -3
View File
@@ -60,7 +60,7 @@ ChatWidgetInput::ChatWidgetInput(ChatWidget *widget)
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) {
auto c = _chatWidget->getChannel();
if (c == nullptr) {
@@ -137,5 +137,6 @@ void ChatWidgetInput::resizeEvent(QResizeEvent *)
_edit.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
}
}
}
} // namespace widgets
} // namespace chatterino
+2 -4
View File
@@ -1,5 +1,4 @@
#ifndef CHATWIDGETINPUT_H
#define CHATWIDGETINPUT_H
#pragma once
#include "resizingtextedit.h"
#include "widgets/chatwidgetheaderbutton.h"
@@ -49,7 +48,6 @@ private slots:
void editTextChanged();
// void editKeyPressed(QKeyEvent *event);
};
} // namespace widgets
} // namespace chatterino
#endif // CHATWIDGETINPUT_H
+3 -2
View File
@@ -137,5 +137,6 @@ void FancyButton::onMouseEffectTimeout()
update();
}
}
}
}
} // namespace widgets
} // namespace chatterino
+4 -5
View File
@@ -1,5 +1,4 @@
#ifndef FANCYBUTTON_H
#define FANCYBUTTON_H
#pragma once
#include <QMouseEvent>
#include <QPainter>
@@ -9,6 +8,7 @@
namespace chatterino {
namespace widgets {
class FancyButton : public QWidget
{
struct ClickEffect {
@@ -49,7 +49,6 @@ private:
void onMouseEffectTimeout();
};
}
}
#endif // FANCYBUTTON_H
} // namespace widgets
} // namespace chatterino
+1
View File
@@ -150,5 +150,6 @@ Notebook &MainWindow::getNotebook()
{
return _notebook;
}
} // namespace widgets
} // namespace chatterino
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#pragma once
#include "widgets/notebook.h"
#include "widgets/titlebar.h"
@@ -42,5 +41,3 @@ private:
} // namespace widgets
} // namespace chatterino
#endif // MAINWINDOW_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef NOTEBOOK_H
#define NOTEBOOK_H
#pragma once
#include "widgets/notebookbutton.h"
#include "widgets/notebookpage.h"
@@ -63,5 +62,3 @@ public:
} // namespace widgets
} // namespace chatterino
#endif // NOTEBOOK_H
+3 -2
View File
@@ -102,5 +102,6 @@ void NotebookButton::mouseReleaseEvent(QMouseEvent *event)
FancyButton::mouseReleaseEvent(event);
}
}
}
} // namespace widgets
} // namespace chatterino
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef NOTEBOOKBUTTON_H
#define NOTEBOOKBUTTON_H
#pragma once
#include "fancybutton.h"
@@ -36,5 +35,3 @@ private:
} // namespace widgets
} // namespace chatterino
#endif // NOTEBOOKBUTTON_H
+1 -2
View File
@@ -49,8 +49,7 @@ NotebookTab *NotebookPage::getTab() const
return _tab;
}
void
NotebookPage::addChat(bool openChannelNameDialog)
void NotebookPage::addChat(bool openChannelNameDialog)
{
ChatWidget *w = new ChatWidget();
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef NOTEBOOKPAGE_H
#define NOTEBOOKPAGE_H
#pragma once
#include "widgets/chatwidget.h"
#include "widgets/notebookpage.h"
@@ -82,5 +81,3 @@ public:
} // namespace widgets
} // namespace chatterino
#endif // NOTEBOOKPAGE_H
+3 -2
View File
@@ -50,5 +50,6 @@ void NotebookPageDropPreview::setBounds(const QRect &rect)
animate = true;
}
}
}
} // namespace widgets
} // namespace chatterino
+2 -4
View File
@@ -1,5 +1,4 @@
#ifndef NOTEBOOKPAGEDROPPREVIEW_H
#define NOTEBOOKPAGEDROPPREVIEW_H
#pragma once
#include <QPropertyAnimation>
#include <QWidget>
@@ -23,7 +22,6 @@ protected:
QRect desiredGeometry;
bool animate;
};
} // namespace widgets
} // namespace chatterino
#endif // NOTEBOOKPAGEDROPPREVIEW_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef NOTEBOOKTAB_H
#define NOTEBOOKTAB_H
#pragma once
#include <QPropertyAnimation>
#include <QWidget>
@@ -83,5 +82,3 @@ public:
} // namespace widgets
} // namespace chatterino
#endif // NOTEBOOKTAB_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef RESIZINGTEXTEDIT_H
#define RESIZINGTEXTEDIT_H
#pragma once
#include <QKeyEvent>
#include <QTextEdit>
@@ -50,5 +49,3 @@ protected:
}
}
};
#endif // RESIZINGTEXTEDIT_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef SCROLLBARHIGHLIGHT_H
#define SCROLLBARHIGHLIGHT_H
#pragma once
#include "QString"
@@ -45,5 +44,3 @@ private:
} // namespace widgets
} // namespace chatterino
#endif // SCROLLBARHIGHLIGHT_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H
#pragma once
#include "settingsmanager.h"
#include "settingssnapshot.h"
@@ -54,5 +53,3 @@ private:
} // namespace widgets
} // namespace chatterino
#endif // SETTINGSDIALOG_H
+1
View File
@@ -71,5 +71,6 @@ void SettingsDialogTab::mousePressEvent(QMouseEvent *event)
_dialog->select(this);
}
} // namespace widgets
} // namespace chatterino
+2 -4
View File
@@ -1,5 +1,4 @@
#ifndef SETTINGSNOTEBOOKTAB_H
#define SETTINGSNOTEBOOKTAB_H
#pragma once
#include <QPaintEvent>
#include <QWidget>
@@ -37,7 +36,6 @@ private:
bool _selected;
};
} // namespace widgets
} // namespace chatterino
#endif // SETTINGSNOTEBOOKTAB_H
+1 -4
View File
@@ -1,5 +1,4 @@
#ifndef SIGNALLABEL_H
#define SIGNALLABEL_H
#pragma once
#include <QFlags>
#include <QLabel>
@@ -52,5 +51,3 @@ protected:
event->ignore();
}
};
#endif // SIGNALLABEL_H
+3 -2
View File
@@ -38,5 +38,6 @@ void TextInputDialog::cancelButtonClicked()
reject();
close();
}
}
}
} // namespace widgets
} // namespace chatterino
+3 -5
View File
@@ -1,5 +1,4 @@
#ifndef TEXTINPUTDIALOG_H
#define TEXTINPUTDIALOG_H
#pragma once
#include <QDialog>
#include <QHBoxLayout>
@@ -39,7 +38,6 @@ private slots:
void okButtonClicked();
void cancelButtonClicked();
};
}
}
#endif // TEXTINPUTDIALOG_H
} // namespace widgets
} // namespace chatterino
+4 -2
View File
@@ -2,10 +2,12 @@
namespace chatterino {
namespace widgets {
TitleBar::TitleBar(QWidget *parent)
: QWidget(parent)
{
setFixedHeight(32);
}
}
}
} // namespace widgets
} // namespace chatterino
+4 -5
View File
@@ -1,16 +1,15 @@
#ifndef TITLEBAR_H
#define TITLEBAR_H
#pragma once
#include <QWidget>
namespace chatterino {
namespace widgets {
class TitleBar : public QWidget
{
public:
TitleBar(QWidget *parent = nullptr);
};
}
}
#endif // TITLEBAR_H
} // namespace widgets
} // namespace chatterino