mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 09:30:47 +03:00
Remove extra clang-format options
This commit is contained in:
parent
18e9fd6ada
commit
0c0ac68bc2
30 changed files with 61 additions and 120 deletions
|
@ -3,21 +3,11 @@ Language: Cpp
|
|||
AccessModifierOffset: -8
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
BasedOnStyle: Mozilla
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBraces: Linux
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
ColumnLimit: 100
|
||||
CompactNamespaces: false
|
||||
IndentCaseLabels: false
|
||||
IndentWidth: 8
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
PointerAlignment: Right
|
||||
|
|
|
@ -37,25 +37,15 @@ private:
|
|||
class Deserializable
|
||||
{
|
||||
public:
|
||||
virtual void deserialize(const QJsonValue &)
|
||||
{
|
||||
}
|
||||
virtual void deserialize(const QJsonObject &)
|
||||
{
|
||||
}
|
||||
virtual void deserialize(const QJsonDocument &)
|
||||
{
|
||||
}
|
||||
virtual ~Deserializable()
|
||||
{
|
||||
}
|
||||
virtual void deserialize(const QJsonValue &) {}
|
||||
virtual void deserialize(const QJsonObject &) {}
|
||||
virtual void deserialize(const QJsonDocument &) {}
|
||||
virtual ~Deserializable() {}
|
||||
};
|
||||
|
||||
class Serializable
|
||||
{
|
||||
public:
|
||||
virtual QJsonObject serialize() const = 0;
|
||||
virtual ~Serializable()
|
||||
{
|
||||
}
|
||||
virtual ~Serializable() {}
|
||||
};
|
||||
|
|
|
@ -41,7 +41,8 @@ namespace events = matrix::events;
|
|||
class RoomState
|
||||
{
|
||||
public:
|
||||
// Calculate room data that are not immediatly accessible. Like room name and avatar.
|
||||
// Calculate room data that are not immediatly accessible. Like room name and
|
||||
// avatar.
|
||||
//
|
||||
// e.g If the room is 1-on-1 name and avatar should be extracted from a user.
|
||||
void resolveName();
|
||||
|
@ -76,8 +77,8 @@ private:
|
|||
QUrl avatar_;
|
||||
QString name_;
|
||||
|
||||
// It defines the user whose avatar is used for the room. If the room has an avatar
|
||||
// event this should be empty.
|
||||
// It defines the user whose avatar is used for the room. If the room has an
|
||||
// avatar event this should be empty.
|
||||
QString userAvatar_;
|
||||
};
|
||||
|
||||
|
|
|
@ -106,7 +106,8 @@ private:
|
|||
void updateLastSender(const QString &user_id, TimelineDirection direction);
|
||||
void notifyForLastEvent();
|
||||
|
||||
// Used to determine whether or not we should prefix a message with the sender's name.
|
||||
// Used to determine whether or not we should prefix a message with the
|
||||
// sender's name.
|
||||
bool isSenderRendered(const QString &user_id, TimelineDirection direction);
|
||||
|
||||
bool isPendingMessage(const QString &eventid,
|
||||
|
|
|
@ -26,7 +26,8 @@ namespace matrix
|
|||
namespace events
|
||||
{
|
||||
/*
|
||||
* This is the first event in a room and cannot be changed. It acts as the root of all other events.
|
||||
* This is the first event in a room and cannot be changed. It acts as the root
|
||||
* of all other events.
|
||||
*/
|
||||
|
||||
class CreateEventContent
|
||||
|
|
|
@ -26,7 +26,8 @@ namespace matrix
|
|||
namespace events
|
||||
{
|
||||
/*
|
||||
* A topic is a short message detailing what is currently being discussed in the room.
|
||||
* A topic is a short message detailing what is currently being discussed in the
|
||||
* room.
|
||||
*/
|
||||
|
||||
class TopicEventContent
|
||||
|
|
|
@ -16,9 +16,9 @@ public:
|
|||
setFont(font);
|
||||
setStyleSheet(
|
||||
"QMenu { color: black; background-color: white; margin: 0px;}"
|
||||
"QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; "
|
||||
"margin: "
|
||||
"2px 0px; }"
|
||||
"QMenu::item {"
|
||||
"color: black; padding: 7px 20px; border: 1px solid transparent;"
|
||||
"margin: 2px 0px; }"
|
||||
"QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
|
||||
};
|
||||
|
||||
|
|
|
@ -126,7 +126,8 @@ Cache::insertRoomState(lmdb::txn &txn, const QString &roomid, const RoomState &s
|
|||
auto memberEvent = QJsonDocument(membership.serialize()).toBinaryData();
|
||||
|
||||
switch (membership.content().membershipState()) {
|
||||
// We add or update (e.g invite -> join) a new user to the membership list.
|
||||
// We add or update (e.g invite -> join) a new user to the membership
|
||||
// list.
|
||||
case events::Membership::Invite:
|
||||
case events::Membership::Join: {
|
||||
lmdb::dbi_put(txn,
|
||||
|
|
|
@ -80,6 +80,4 @@ EmojiCategory::EmojiCategory(QString category, QList<Emoji> emoji, QWidget *pare
|
|||
connect(emojiListView_, &QListView::clicked, this, &EmojiCategory::clickIndex);
|
||||
}
|
||||
|
||||
EmojiCategory::~EmojiCategory()
|
||||
{
|
||||
}
|
||||
EmojiCategory::~EmojiCategory() {}
|
||||
|
|
|
@ -220,9 +220,9 @@ EmojiPanel::showEmojiCategory(const EmojiCategory *category)
|
|||
|
||||
// HACK
|
||||
// If we want to go to a previous category and position the label at the top
|
||||
// the 6*50 offset won't work because not all the categories have the same height.
|
||||
// To ensure the category is at the top, we move to the top
|
||||
// and go as normal to the next category.
|
||||
// the 6*50 offset won't work because not all the categories have the same
|
||||
// height. To ensure the category is at the top, we move to the top and go as
|
||||
// normal to the next category.
|
||||
if (current > posToGo)
|
||||
this->scrollArea_->ensureVisible(0, 0, 0, 0);
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#include "Deserializable.h"
|
||||
#include "Login.h"
|
||||
|
||||
LoginRequest::LoginRequest()
|
||||
{
|
||||
}
|
||||
LoginRequest::LoginRequest() {}
|
||||
|
||||
LoginRequest::LoginRequest(QString username, QString password)
|
||||
: user_(username)
|
||||
|
|
|
@ -223,8 +223,8 @@ void
|
|||
LoginPage::versionError(QString error)
|
||||
{
|
||||
// Matrix homeservers are often kept on a subdomain called 'matrix'
|
||||
// so let's try that next, unless the address was set explicitly or the domain part of the
|
||||
// username already points to this subdomain
|
||||
// so let's try that next, unless the address was set explicitly or the domain
|
||||
// part of the username already points to this subdomain
|
||||
QUrl currentServer = client_->getHomeServer();
|
||||
QString mxidAddress = matrixid_input_->text().split(":").at(1);
|
||||
if (currentServer.host() == inferredServerAddress_ &&
|
||||
|
@ -297,6 +297,4 @@ LoginPage::onBackButtonClicked()
|
|||
emit backButtonClicked();
|
||||
}
|
||||
|
||||
LoginPage::~LoginPage()
|
||||
{
|
||||
}
|
||||
LoginPage::~LoginPage() {}
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Config.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QLayout>
|
||||
|
@ -244,6 +244,4 @@ MainWindow::instance()
|
|||
return instance_;
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
}
|
||||
MainWindow::~MainWindow() {}
|
||||
|
|
|
@ -64,8 +64,8 @@ MatrixClient::onVersionsResponse(QNetworkReply *reply)
|
|||
int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
|
||||
if (status_code == 404) {
|
||||
emit versionError(
|
||||
"Versions endpoint was not found on the server. Possibly not a Matrix server");
|
||||
emit versionError("Versions endpoint was not found on the server. Possibly "
|
||||
"not a Matrix server");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -581,8 +581,8 @@ MatrixClient::sync() noexcept
|
|||
query.addQueryItem("access_token", token_);
|
||||
|
||||
if (next_batch_.isEmpty()) {
|
||||
qDebug()
|
||||
<< "Sync requires a valid next_batch token. Initial sync should be performed.";
|
||||
qDebug() << "Sync requires a valid next_batch token. Initial sync should "
|
||||
"be performed.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -684,8 +684,8 @@ MatrixClient::versions() noexcept
|
|||
void
|
||||
MatrixClient::getOwnProfile() noexcept
|
||||
{
|
||||
// FIXME: Remove settings from the matrix client. The class should store the user's matrix
|
||||
// ID.
|
||||
// FIXME: Remove settings from the matrix client. The class should store the
|
||||
// user's matrix ID.
|
||||
QSettings settings;
|
||||
auto userid = settings.value("auth/user_id", "").toString();
|
||||
|
||||
|
|
|
@ -181,6 +181,4 @@ RegisterPage::onRegisterButtonClicked()
|
|||
}
|
||||
}
|
||||
|
||||
RegisterPage::~RegisterPage()
|
||||
{
|
||||
}
|
||||
RegisterPage::~RegisterPage() {}
|
||||
|
|
|
@ -152,8 +152,8 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
|
|||
font.setBold(false);
|
||||
p.setFont(font);
|
||||
|
||||
// The limit is the space between the end of the username and the start of the
|
||||
// timestamp.
|
||||
// The limit is the space between the end of the username and the start of
|
||||
// the timestamp.
|
||||
int descriptionLimit =
|
||||
std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - nameWidth - 5);
|
||||
auto description =
|
||||
|
@ -310,6 +310,4 @@ RoomInfoListItem::mousePressEvent(QMouseEvent *event)
|
|||
ripple_overlay_->addRipple(ripple);
|
||||
}
|
||||
|
||||
RoomInfoListItem::~RoomInfoListItem()
|
||||
{
|
||||
}
|
||||
RoomInfoListItem::~RoomInfoListItem() {}
|
||||
|
|
|
@ -61,9 +61,7 @@ RoomList::RoomList(QSharedPointer<MatrixClient> client, QWidget *parent)
|
|||
SLOT(updateRoomAvatar(const QString &, const QPixmap &)));
|
||||
}
|
||||
|
||||
RoomList::~RoomList()
|
||||
{
|
||||
}
|
||||
RoomList::~RoomList() {}
|
||||
|
||||
void
|
||||
RoomList::clear()
|
||||
|
|
|
@ -213,6 +213,4 @@ TextInputWidget::hideUploadSpinner()
|
|||
spinner_->stop();
|
||||
}
|
||||
|
||||
TextInputWidget::~TextInputWidget()
|
||||
{
|
||||
}
|
||||
TextInputWidget::~TextInputWidget() {}
|
||||
|
|
|
@ -461,6 +461,4 @@ TimelineItem::descriptiveTime(const QDateTime &then)
|
|||
return then.toString("dd/MM/yy");
|
||||
}
|
||||
|
||||
TimelineItem::~TimelineItem()
|
||||
{
|
||||
}
|
||||
TimelineItem::~TimelineItem() {}
|
||||
|
|
|
@ -37,9 +37,7 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<MatrixClient> client, QW
|
|||
client_.data(), &MatrixClient::messageSent, this, &TimelineViewManager::messageSent);
|
||||
}
|
||||
|
||||
TimelineViewManager::~TimelineViewManager()
|
||||
{
|
||||
}
|
||||
TimelineViewManager::~TimelineViewManager() {}
|
||||
|
||||
void
|
||||
TimelineViewManager::messageSent(const QString &event_id, const QString &roomid, int txn_id)
|
||||
|
|
|
@ -137,6 +137,4 @@ TopRoomBar::setRoomSettings(QSharedPointer<RoomSettings> settings)
|
|||
roomSettings_ = settings;
|
||||
}
|
||||
|
||||
TopRoomBar::~TopRoomBar()
|
||||
{
|
||||
}
|
||||
TopRoomBar::~TopRoomBar() {}
|
||||
|
|
|
@ -120,9 +120,7 @@ UserInfoWidget::closeLogoutDialog(bool isLoggingOut)
|
|||
emit logout();
|
||||
}
|
||||
|
||||
UserInfoWidget::~UserInfoWidget()
|
||||
{
|
||||
}
|
||||
UserInfoWidget::~UserInfoWidget() {}
|
||||
|
||||
void
|
||||
UserInfoWidget::resizeEvent(QResizeEvent *event)
|
||||
|
|
|
@ -19,9 +19,7 @@ Avatar::Avatar(QWidget *parent)
|
|||
setSizePolicy(policy);
|
||||
}
|
||||
|
||||
Avatar::~Avatar()
|
||||
{
|
||||
}
|
||||
Avatar::~Avatar() {}
|
||||
|
||||
QColor
|
||||
Avatar::textColor() const
|
||||
|
|
|
@ -22,9 +22,7 @@ Badge::Badge(const QString &text, QWidget *parent)
|
|||
setText(text);
|
||||
}
|
||||
|
||||
Badge::~Badge()
|
||||
{
|
||||
}
|
||||
Badge::~Badge() {}
|
||||
|
||||
void
|
||||
Badge::init()
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
#include "ThemeManager.h"
|
||||
|
||||
// The ampersand is automatically set in QPushButton or QCheckbx
|
||||
// by KDEPlatformTheme plugin in Qt5. [https://bugs.kde.org/show_bug.cgi?id=337491]
|
||||
// by KDEPlatformTheme plugin in Qt5.
|
||||
// [https://bugs.kde.org/show_bug.cgi?id=337491]
|
||||
//
|
||||
// A workaroud is to add
|
||||
//
|
||||
|
@ -79,9 +80,7 @@ FlatButton::FlatButton(const QString &text, ui::Role role, QWidget *parent, ui::
|
|||
setRole(role);
|
||||
}
|
||||
|
||||
FlatButton::~FlatButton()
|
||||
{
|
||||
}
|
||||
FlatButton::~FlatButton() {}
|
||||
|
||||
void
|
||||
FlatButton::applyPreset(ui::ButtonPreset preset)
|
||||
|
@ -611,9 +610,7 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent)
|
|||
addTransition(button_, QEvent::FocusOut, pressed_state_, hovered_state_);
|
||||
}
|
||||
|
||||
FlatButtonStateMachine::~FlatButtonStateMachine()
|
||||
{
|
||||
}
|
||||
FlatButtonStateMachine::~FlatButtonStateMachine() {}
|
||||
|
||||
void
|
||||
FlatButtonStateMachine::setOverlayOpacity(qreal opacity)
|
||||
|
|
|
@ -70,9 +70,7 @@ RaisedButton::RaisedButton(const QString &text, QWidget *parent)
|
|||
setText(text);
|
||||
}
|
||||
|
||||
RaisedButton::~RaisedButton()
|
||||
{
|
||||
}
|
||||
RaisedButton::~RaisedButton() {}
|
||||
|
||||
bool
|
||||
RaisedButton::event(QEvent *event)
|
||||
|
|
|
@ -25,9 +25,7 @@ Ripple::Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent)
|
|||
init();
|
||||
}
|
||||
|
||||
Ripple::~Ripple()
|
||||
{
|
||||
}
|
||||
Ripple::~Ripple() {}
|
||||
|
||||
void
|
||||
Ripple::setRadius(qreal radius)
|
||||
|
|
|
@ -11,9 +11,7 @@ RippleOverlay::RippleOverlay(QWidget *parent)
|
|||
setAttribute(Qt::WA_NoSystemBackground);
|
||||
}
|
||||
|
||||
RippleOverlay::~RippleOverlay()
|
||||
{
|
||||
}
|
||||
RippleOverlay::~RippleOverlay() {}
|
||||
|
||||
void
|
||||
RippleOverlay::addRipple(Ripple *ripple)
|
||||
|
|
|
@ -32,9 +32,7 @@ TextField::TextField(QWidget *parent)
|
|||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
||||
TextField::~TextField()
|
||||
{
|
||||
}
|
||||
TextField::~TextField() {}
|
||||
|
||||
void
|
||||
TextField::setBackgroundColor(const QColor &color)
|
||||
|
@ -199,7 +197,8 @@ TextField::paintEvent(QPaintEvent *event)
|
|||
|
||||
if (text().isEmpty()) {
|
||||
painter.setOpacity(1 - state_machine_->progress());
|
||||
// painter.fillRect(rect(), parentWidget()->palette().color(backgroundRole()));
|
||||
// painter.fillRect(rect(),
|
||||
// parentWidget()->palette().color(backgroundRole()));
|
||||
painter.fillRect(rect(), backgroundColor());
|
||||
}
|
||||
|
||||
|
@ -273,9 +272,7 @@ TextFieldStateMachine::TextFieldStateMachine(TextField *parent)
|
|||
connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties()));
|
||||
}
|
||||
|
||||
TextFieldStateMachine::~TextFieldStateMachine()
|
||||
{
|
||||
}
|
||||
TextFieldStateMachine::~TextFieldStateMachine() {}
|
||||
|
||||
void
|
||||
TextFieldStateMachine::setLabel(TextFieldLabel *label)
|
||||
|
@ -352,9 +349,7 @@ TextFieldLabel::TextFieldLabel(TextField *parent)
|
|||
setFont(font);
|
||||
}
|
||||
|
||||
TextFieldLabel::~TextFieldLabel()
|
||||
{
|
||||
}
|
||||
TextFieldLabel::~TextFieldLabel() {}
|
||||
|
||||
void
|
||||
TextFieldLabel::paintEvent(QPaintEvent *)
|
||||
|
|
|
@ -22,9 +22,7 @@ Theme::Theme(QObject *parent)
|
|||
setColor("Transparent", ui::Color::Transparent);
|
||||
}
|
||||
|
||||
Theme::~Theme()
|
||||
{
|
||||
}
|
||||
Theme::~Theme() {}
|
||||
|
||||
QColor
|
||||
Theme::rgba(int r, int g, int b, qreal a) const
|
||||
|
|
Loading…
Reference in a new issue