Remove extra clang-format options

This commit is contained in:
Konstantinos Sideris 2017-10-01 12:11:33 +03:00
parent 18e9fd6ada
commit 0c0ac68bc2
30 changed files with 61 additions and 120 deletions

View File

@ -3,21 +3,11 @@ Language: Cpp
AccessModifierOffset: -8 AccessModifierOffset: -8
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true AlignConsecutiveAssignments: true
AlignEscapedNewlinesLeft: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortFunctionsOnASingleLine: Empty AllowShortFunctionsOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
BasedOnStyle: Mozilla BasedOnStyle: Mozilla
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Linux BreakBeforeBraces: Linux
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 100 ColumnLimit: 100
CompactNamespaces: false
IndentCaseLabels: false IndentCaseLabels: false
IndentWidth: 8 IndentWidth: 8
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
PointerAlignment: Right PointerAlignment: Right

View File

@ -37,25 +37,15 @@ private:
class Deserializable class Deserializable
{ {
public: public:
virtual void deserialize(const QJsonValue &) virtual void deserialize(const QJsonValue &) {}
{ virtual void deserialize(const QJsonObject &) {}
} virtual void deserialize(const QJsonDocument &) {}
virtual void deserialize(const QJsonObject &) virtual ~Deserializable() {}
{
}
virtual void deserialize(const QJsonDocument &)
{
}
virtual ~Deserializable()
{
}
}; };
class Serializable class Serializable
{ {
public: public:
virtual QJsonObject serialize() const = 0; virtual QJsonObject serialize() const = 0;
virtual ~Serializable() virtual ~Serializable() {}
{
}
}; };

View File

@ -41,7 +41,8 @@ namespace events = matrix::events;
class RoomState class RoomState
{ {
public: 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. // e.g If the room is 1-on-1 name and avatar should be extracted from a user.
void resolveName(); void resolveName();
@ -76,8 +77,8 @@ private:
QUrl avatar_; QUrl avatar_;
QString name_; QString name_;
// It defines the user whose avatar is used for the room. If the room has an avatar // It defines the user whose avatar is used for the room. If the room has an
// event this should be empty. // avatar event this should be empty.
QString userAvatar_; QString userAvatar_;
}; };

View File

@ -106,7 +106,8 @@ private:
void updateLastSender(const QString &user_id, TimelineDirection direction); void updateLastSender(const QString &user_id, TimelineDirection direction);
void notifyForLastEvent(); 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 isSenderRendered(const QString &user_id, TimelineDirection direction);
bool isPendingMessage(const QString &eventid, bool isPendingMessage(const QString &eventid,

View File

@ -26,7 +26,8 @@ namespace matrix
namespace events 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 class CreateEventContent

View File

@ -26,7 +26,8 @@ namespace matrix
namespace events 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 class TopicEventContent

View File

@ -16,9 +16,9 @@ public:
setFont(font); setFont(font);
setStyleSheet( setStyleSheet(
"QMenu { color: black; background-color: white; margin: 0px;}" "QMenu { color: black; background-color: white; margin: 0px;}"
"QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; " "QMenu::item {"
"margin: " "color: black; padding: 7px 20px; border: 1px solid transparent;"
"2px 0px; }" "margin: 2px 0px; }"
"QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }"); "QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }");
}; };

View File

@ -126,7 +126,8 @@ Cache::insertRoomState(lmdb::txn &txn, const QString &roomid, const RoomState &s
auto memberEvent = QJsonDocument(membership.serialize()).toBinaryData(); auto memberEvent = QJsonDocument(membership.serialize()).toBinaryData();
switch (membership.content().membershipState()) { 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::Invite:
case events::Membership::Join: { case events::Membership::Join: {
lmdb::dbi_put(txn, lmdb::dbi_put(txn,

View File

@ -80,6 +80,4 @@ EmojiCategory::EmojiCategory(QString category, QList<Emoji> emoji, QWidget *pare
connect(emojiListView_, &QListView::clicked, this, &EmojiCategory::clickIndex); connect(emojiListView_, &QListView::clicked, this, &EmojiCategory::clickIndex);
} }
EmojiCategory::~EmojiCategory() EmojiCategory::~EmojiCategory() {}
{
}

View File

@ -220,9 +220,9 @@ EmojiPanel::showEmojiCategory(const EmojiCategory *category)
// HACK // HACK
// If we want to go to a previous category and position the label at the top // 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. // the 6*50 offset won't work because not all the categories have the same
// To ensure the category is at the top, we move to the top // height. To ensure the category is at the top, we move to the top and go as
// and go as normal to the next category. // normal to the next category.
if (current > posToGo) if (current > posToGo)
this->scrollArea_->ensureVisible(0, 0, 0, 0); this->scrollArea_->ensureVisible(0, 0, 0, 0);

View File

@ -22,9 +22,7 @@
#include "Deserializable.h" #include "Deserializable.h"
#include "Login.h" #include "Login.h"
LoginRequest::LoginRequest() LoginRequest::LoginRequest() {}
{
}
LoginRequest::LoginRequest(QString username, QString password) LoginRequest::LoginRequest(QString username, QString password)
: user_(username) : user_(username)

View File

@ -223,8 +223,8 @@ void
LoginPage::versionError(QString error) LoginPage::versionError(QString error)
{ {
// Matrix homeservers are often kept on a subdomain called 'matrix' // 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 // so let's try that next, unless the address was set explicitly or the domain
// username already points to this subdomain // part of the username already points to this subdomain
QUrl currentServer = client_->getHomeServer(); QUrl currentServer = client_->getHomeServer();
QString mxidAddress = matrixid_input_->text().split(":").at(1); QString mxidAddress = matrixid_input_->text().split(":").at(1);
if (currentServer.host() == inferredServerAddress_ && if (currentServer.host() == inferredServerAddress_ &&
@ -297,6 +297,4 @@ LoginPage::onBackButtonClicked()
emit backButtonClicked(); emit backButtonClicked();
} }
LoginPage::~LoginPage() LoginPage::~LoginPage() {}
{
}

View File

@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "Config.h"
#include "MainWindow.h" #include "MainWindow.h"
#include "Config.h"
#include <QApplication> #include <QApplication>
#include <QLayout> #include <QLayout>
@ -244,6 +244,4 @@ MainWindow::instance()
return instance_; return instance_;
} }
MainWindow::~MainWindow() MainWindow::~MainWindow() {}
{
}

View File

@ -64,8 +64,8 @@ MatrixClient::onVersionsResponse(QNetworkReply *reply)
int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int status_code = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (status_code == 404) { if (status_code == 404) {
emit versionError( emit versionError("Versions endpoint was not found on the server. Possibly "
"Versions endpoint was not found on the server. Possibly not a Matrix server"); "not a Matrix server");
return; return;
} }
@ -581,8 +581,8 @@ MatrixClient::sync() noexcept
query.addQueryItem("access_token", token_); query.addQueryItem("access_token", token_);
if (next_batch_.isEmpty()) { if (next_batch_.isEmpty()) {
qDebug() qDebug() << "Sync requires a valid next_batch token. Initial sync should "
<< "Sync requires a valid next_batch token. Initial sync should be performed."; "be performed.";
return; return;
} }
@ -684,8 +684,8 @@ MatrixClient::versions() noexcept
void void
MatrixClient::getOwnProfile() noexcept MatrixClient::getOwnProfile() noexcept
{ {
// FIXME: Remove settings from the matrix client. The class should store the user's matrix // FIXME: Remove settings from the matrix client. The class should store the
// ID. // user's matrix ID.
QSettings settings; QSettings settings;
auto userid = settings.value("auth/user_id", "").toString(); auto userid = settings.value("auth/user_id", "").toString();

View File

@ -181,6 +181,4 @@ RegisterPage::onRegisterButtonClicked()
} }
} }
RegisterPage::~RegisterPage() RegisterPage::~RegisterPage() {}
{
}

View File

@ -152,8 +152,8 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
font.setBold(false); font.setBold(false);
p.setFont(font); p.setFont(font);
// The limit is the space between the end of the username and the start of the // The limit is the space between the end of the username and the start of
// timestamp. // the timestamp.
int descriptionLimit = int descriptionLimit =
std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - nameWidth - 5); std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - nameWidth - 5);
auto description = auto description =
@ -310,6 +310,4 @@ RoomInfoListItem::mousePressEvent(QMouseEvent *event)
ripple_overlay_->addRipple(ripple); ripple_overlay_->addRipple(ripple);
} }
RoomInfoListItem::~RoomInfoListItem() RoomInfoListItem::~RoomInfoListItem() {}
{
}

View File

@ -61,9 +61,7 @@ RoomList::RoomList(QSharedPointer<MatrixClient> client, QWidget *parent)
SLOT(updateRoomAvatar(const QString &, const QPixmap &))); SLOT(updateRoomAvatar(const QString &, const QPixmap &)));
} }
RoomList::~RoomList() RoomList::~RoomList() {}
{
}
void void
RoomList::clear() RoomList::clear()

View File

@ -213,6 +213,4 @@ TextInputWidget::hideUploadSpinner()
spinner_->stop(); spinner_->stop();
} }
TextInputWidget::~TextInputWidget() TextInputWidget::~TextInputWidget() {}
{
}

View File

@ -461,6 +461,4 @@ TimelineItem::descriptiveTime(const QDateTime &then)
return then.toString("dd/MM/yy"); return then.toString("dd/MM/yy");
} }
TimelineItem::~TimelineItem() TimelineItem::~TimelineItem() {}
{
}

View File

@ -37,9 +37,7 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<MatrixClient> client, QW
client_.data(), &MatrixClient::messageSent, this, &TimelineViewManager::messageSent); client_.data(), &MatrixClient::messageSent, this, &TimelineViewManager::messageSent);
} }
TimelineViewManager::~TimelineViewManager() TimelineViewManager::~TimelineViewManager() {}
{
}
void void
TimelineViewManager::messageSent(const QString &event_id, const QString &roomid, int txn_id) TimelineViewManager::messageSent(const QString &event_id, const QString &roomid, int txn_id)

View File

@ -137,6 +137,4 @@ TopRoomBar::setRoomSettings(QSharedPointer<RoomSettings> settings)
roomSettings_ = settings; roomSettings_ = settings;
} }
TopRoomBar::~TopRoomBar() TopRoomBar::~TopRoomBar() {}
{
}

View File

@ -120,9 +120,7 @@ UserInfoWidget::closeLogoutDialog(bool isLoggingOut)
emit logout(); emit logout();
} }
UserInfoWidget::~UserInfoWidget() UserInfoWidget::~UserInfoWidget() {}
{
}
void void
UserInfoWidget::resizeEvent(QResizeEvent *event) UserInfoWidget::resizeEvent(QResizeEvent *event)

View File

@ -19,9 +19,7 @@ Avatar::Avatar(QWidget *parent)
setSizePolicy(policy); setSizePolicy(policy);
} }
Avatar::~Avatar() Avatar::~Avatar() {}
{
}
QColor QColor
Avatar::textColor() const Avatar::textColor() const

View File

@ -22,9 +22,7 @@ Badge::Badge(const QString &text, QWidget *parent)
setText(text); setText(text);
} }
Badge::~Badge() Badge::~Badge() {}
{
}
void void
Badge::init() Badge::init()

View File

@ -12,7 +12,8 @@
#include "ThemeManager.h" #include "ThemeManager.h"
// The ampersand is automatically set in QPushButton or QCheckbx // 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 // A workaroud is to add
// //
@ -79,9 +80,7 @@ FlatButton::FlatButton(const QString &text, ui::Role role, QWidget *parent, ui::
setRole(role); setRole(role);
} }
FlatButton::~FlatButton() FlatButton::~FlatButton() {}
{
}
void void
FlatButton::applyPreset(ui::ButtonPreset preset) FlatButton::applyPreset(ui::ButtonPreset preset)
@ -611,9 +610,7 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent)
addTransition(button_, QEvent::FocusOut, pressed_state_, hovered_state_); addTransition(button_, QEvent::FocusOut, pressed_state_, hovered_state_);
} }
FlatButtonStateMachine::~FlatButtonStateMachine() FlatButtonStateMachine::~FlatButtonStateMachine() {}
{
}
void void
FlatButtonStateMachine::setOverlayOpacity(qreal opacity) FlatButtonStateMachine::setOverlayOpacity(qreal opacity)

View File

@ -70,9 +70,7 @@ RaisedButton::RaisedButton(const QString &text, QWidget *parent)
setText(text); setText(text);
} }
RaisedButton::~RaisedButton() RaisedButton::~RaisedButton() {}
{
}
bool bool
RaisedButton::event(QEvent *event) RaisedButton::event(QEvent *event)

View File

@ -25,9 +25,7 @@ Ripple::Ripple(const QPoint &center, RippleOverlay *overlay, QObject *parent)
init(); init();
} }
Ripple::~Ripple() Ripple::~Ripple() {}
{
}
void void
Ripple::setRadius(qreal radius) Ripple::setRadius(qreal radius)

View File

@ -11,9 +11,7 @@ RippleOverlay::RippleOverlay(QWidget *parent)
setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NoSystemBackground);
} }
RippleOverlay::~RippleOverlay() RippleOverlay::~RippleOverlay() {}
{
}
void void
RippleOverlay::addRipple(Ripple *ripple) RippleOverlay::addRipple(Ripple *ripple)

View File

@ -32,9 +32,7 @@ TextField::TextField(QWidget *parent)
QCoreApplication::processEvents(); QCoreApplication::processEvents();
} }
TextField::~TextField() TextField::~TextField() {}
{
}
void void
TextField::setBackgroundColor(const QColor &color) TextField::setBackgroundColor(const QColor &color)
@ -199,7 +197,8 @@ TextField::paintEvent(QPaintEvent *event)
if (text().isEmpty()) { if (text().isEmpty()) {
painter.setOpacity(1 - state_machine_->progress()); painter.setOpacity(1 - state_machine_->progress());
// painter.fillRect(rect(), parentWidget()->palette().color(backgroundRole())); // painter.fillRect(rect(),
// parentWidget()->palette().color(backgroundRole()));
painter.fillRect(rect(), backgroundColor()); painter.fillRect(rect(), backgroundColor());
} }
@ -273,9 +272,7 @@ TextFieldStateMachine::TextFieldStateMachine(TextField *parent)
connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties())); connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties()));
} }
TextFieldStateMachine::~TextFieldStateMachine() TextFieldStateMachine::~TextFieldStateMachine() {}
{
}
void void
TextFieldStateMachine::setLabel(TextFieldLabel *label) TextFieldStateMachine::setLabel(TextFieldLabel *label)
@ -352,9 +349,7 @@ TextFieldLabel::TextFieldLabel(TextField *parent)
setFont(font); setFont(font);
} }
TextFieldLabel::~TextFieldLabel() TextFieldLabel::~TextFieldLabel() {}
{
}
void void
TextFieldLabel::paintEvent(QPaintEvent *) TextFieldLabel::paintEvent(QPaintEvent *)

View File

@ -22,9 +22,7 @@ Theme::Theme(QObject *parent)
setColor("Transparent", ui::Color::Transparent); setColor("Transparent", ui::Color::Transparent);
} }
Theme::~Theme() Theme::~Theme() {}
{
}
QColor QColor
Theme::rgba(int r, int g, int b, qreal a) const Theme::rgba(int r, int g, int b, qreal a) const