From d13f6bb870cdda71257f665367be8ef9fca86255 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Tue, 17 May 2022 11:47:01 +0200 Subject: Apply clang-format. --- src/modlistbypriorityproxy.h | 46 +++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'src/modlistbypriorityproxy.h') diff --git a/src/modlistbypriorityproxy.h b/src/modlistbypriorityproxy.h index 0629bef7..5617d222 100644 --- a/src/modlistbypriorityproxy.h +++ b/src/modlistbypriorityproxy.h @@ -6,11 +6,11 @@ #include #include +#include #include #include -#include -#include #include +#include #include "modinfo.h" #include "modlistview.h" @@ -24,7 +24,8 @@ class ModListByPriorityProxy : public QAbstractProxyModel Q_OBJECT public: - explicit ModListByPriorityProxy(Profile* profile, OrganizerCore& core, QObject* parent = nullptr); + explicit ModListByPriorityProxy(Profile* profile, OrganizerCore& core, + QObject* parent = nullptr); ~ModListByPriorityProxy(); void setProfile(Profile* profile); @@ -37,29 +38,35 @@ public: int rowCount(const QModelIndex& parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& child) const override; - QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; + QModelIndex index(int row, int column, + const QModelIndex& parent = QModelIndex()) const override; int columnCount(const QModelIndex& index) const override; bool hasChildren(const QModelIndex& parent) const override; - bool canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const override; - bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override; + bool canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, + int column, const QModelIndex& parent) const override; + bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, + const QModelIndex& parent) override; QModelIndex mapFromSource(const QModelIndex& sourceIndex) const override; QModelIndex mapToSource(const QModelIndex& proxyIndex) const override; public slots: - void onDropEnter(const QMimeData* data, bool dropExpanded, ModListView::DropPosition dropPosition); + void onDropEnter(const QMimeData* data, bool dropExpanded, + ModListView::DropPosition dropPosition); protected slots: void onModelRowsRemoved(const QModelIndex& parent, int first, int last); - void onModelLayoutChanged(const QList& parents = {}, LayoutChangeHint hint = LayoutChangeHint::NoLayoutChangeHint); + void + onModelLayoutChanged(const QList& parents = {}, + LayoutChangeHint hint = LayoutChangeHint::NoLayoutChangeHint); void onModelReset(); - void onModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles = QVector()); + void onModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight, + const QVector& roles = QVector()); private: - // fill the mapping from index to item (required by buildTree), should // only be used for full model reset because it destroys existing references // to tree items @@ -71,13 +78,15 @@ private: // void buildTree(); - struct TreeItem { + struct TreeItem + { ModInfo::Ptr mod; unsigned int index; std::vector children; TreeItem* parent; - std::size_t childIndex(TreeItem* child) const { + std::size_t childIndex(TreeItem* child) const + { for (std::size_t i = 0; i < children.size(); ++i) { if (children[i] == child) { return i; @@ -86,9 +95,10 @@ private: return -1; } - TreeItem() : TreeItem(nullptr, -1) { } - TreeItem(ModInfo::Ptr mod, unsigned int index, TreeItem* parent = nullptr) : - mod(mod), index(index), parent(parent) { } + TreeItem() : TreeItem(nullptr, -1) {} + TreeItem(ModInfo::Ptr mod, unsigned int index, TreeItem* parent = nullptr) + : mod(mod), index(index), parent(parent) + {} }; TreeItem m_Root; @@ -98,9 +108,9 @@ private: OrganizerCore& m_core; Profile* m_profile; - Qt::SortOrder m_sortOrder = Qt::AscendingOrder; - bool m_dropExpanded = false; + Qt::SortOrder m_sortOrder = Qt::AscendingOrder; + bool m_dropExpanded = false; ModListView::DropPosition m_dropPosition = ModListView::DropPosition::OnItem; }; -#endif //GROUPINGPROXY_H +#endif // GROUPINGPROXY_H -- cgit v1.3.1