Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier ROMAN committed Oct 9, 2024
1 parent c94f55f commit 1f2f422
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/autotype/AutoTypeMatchView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class CustomSortFilterProxyModel : public QSortFilterProxyModel
{
public:
explicit CustomSortFilterProxyModel(QObject* parent = nullptr)
: QSortFilterProxyModel(parent){};
: QSortFilterProxyModel(parent) {};
~CustomSortFilterProxyModel() override = default;

// Only search the first three columns (ie, ignore sequence column)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/ApplicationSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class MouseWheelEventFilter : public QObject
{
public:
explicit MouseWheelEventFilter(QObject* parent)
: QObject(parent){};
: QObject(parent) {};

protected:
bool eventFilter(QObject* obj, QEvent* event) override
Expand Down
2 changes: 1 addition & 1 deletion src/gui/entry/EntryView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PasswordStrengthItemDelegate : public QStyledItemDelegate
{
public:
explicit PasswordStrengthItemDelegate(QObject* parent)
: QStyledItemDelegate(parent){};
: QStyledItemDelegate(parent) {};

void initStyleOption(QStyleOptionViewItem* option, const QModelIndex& index) const override
{
Expand Down
5 changes: 4 additions & 1 deletion src/gui/group/GroupModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class GroupModel : public QAbstractItemModel

public:
explicit GroupModel(Database* db, QObject* parent = nullptr);
const Database* database() const {return m_db;}
const Database* database() const
{
return m_db;
}
void changeDatabase(Database* newDb);
QModelIndex index(Group* group) const;
Group* groupFromIndex(const QModelIndex& index) const;
Expand Down
19 changes: 10 additions & 9 deletions src/gui/group/GroupView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ void GroupView::dragMoveEvent(QDragMoveEvent* event)
{
QTreeView::dragMoveEvent(event);

if(event->isAccepted() ){
if (event->isAccepted()) {
// we need to fix the drop action to have the correct cursor icon
fixDropAction(event);
if(event->dropAction() != event->proposedAction()){
if (event->dropAction() != event->proposedAction()) {
event->accept();
}

Expand All @@ -113,7 +113,7 @@ void GroupView::dragMoveEvent(QDragMoveEvent* event)
}
}

void GroupView::dropEvent(QDropEvent *event)
void GroupView::dropEvent(QDropEvent* event)
{
fixDropAction(event);
QTreeView::dropEvent(event);
Expand Down Expand Up @@ -156,11 +156,12 @@ void GroupView::recInitExpanded(Group* group)
}
}

void GroupView::fixDropAction(QDropEvent *event)
void GroupView::fixDropAction(QDropEvent* event)
{
if (event->keyboardModifiers().testFlag(Qt::ControlModifier) && event->possibleActions().testFlag(Qt::CopyAction)) {
event->setDropAction(Qt::CopyAction);
} else if (event->keyboardModifiers().testFlag(Qt::ShiftModifier) && event->possibleActions().testFlag(Qt::MoveAction)) {
} else if (event->keyboardModifiers().testFlag(Qt::ShiftModifier)
&& event->possibleActions().testFlag(Qt::MoveAction)) {
event->setDropAction(Qt::MoveAction);
} else {
static const QString groupMimeDataType = "application/x-keepassx-group";
Expand All @@ -169,18 +170,18 @@ void GroupView::fixDropAction(QDropEvent *event)
bool isGroup = event->mimeData()->hasFormat(groupMimeDataType);
bool isEntry = event->mimeData()->hasFormat(entryMimeDataType);

if(isGroup || isEntry){
if (isGroup || isEntry) {
QByteArray encoded = event->mimeData()->data(isGroup ? groupMimeDataType : entryMimeDataType);
QDataStream stream(&encoded, QIODevice::ReadOnly);

QUuid dbUuid;
QUuid itemUuid;
stream >> dbUuid >> itemUuid;

if(dbUuid != m_model->database()->uuid()){
if(event->possibleActions().testFlag(Qt::CopyAction)){
if (dbUuid != m_model->database()->uuid()) {
if (event->possibleActions().testFlag(Qt::CopyAction)) {
event->setDropAction(Qt::CopyAction);
} else if(event->possibleActions().testFlag(Qt::MoveAction)){
} else if (event->possibleActions().testFlag(Qt::MoveAction)) {
event->setDropAction(Qt::MoveAction);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/reports/ReportsWidgetHealthcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace
{
public:
ReportSortProxyModel(QObject* parent)
: QSortFilterProxyModel(parent){};
: QSortFilterProxyModel(parent) {};
~ReportSortProxyModel() override = default;

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/reports/ReportsWidgetHibp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace
{
public:
ReportSortProxyModel(QObject* parent)
: QSortFilterProxyModel(parent){};
: QSortFilterProxyModel(parent) {};
~ReportSortProxyModel() override = default;

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tag/TagView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TagItemDelegate : public QStyledItemDelegate
{
public:
explicit TagItemDelegate(QObject* parent)
: QStyledItemDelegate(parent){};
: QStyledItemDelegate(parent) {};

void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override
{
Expand Down
2 changes: 1 addition & 1 deletion src/keys/Key.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Key
{
public:
explicit Key(const QUuid& uuid)
: m_uuid(uuid){};
: m_uuid(uuid) {};
Q_DISABLE_COPY(Key);
virtual ~Key() = default;
virtual QByteArray rawKey() const = 0;
Expand Down

0 comments on commit 1f2f422

Please sign in to comment.