From 5bbe9bc5d89f12cb5b10d0da94f0d84c5d70ad90 Mon Sep 17 00:00:00 2001 From: unelsson Date: Sun, 29 Jan 2023 21:42:01 +0200 Subject: [PATCH] cleanup and style (const ref instead of value, consistent ifndef naming) --- apps/opencs/view/filter/filterbox.hpp | 4 ++-- apps/opencs/view/filter/filterdata.hpp | 8 +++----- apps/opencs/view/world/dragrecordtable.cpp | 2 +- apps/opencs/view/world/dragrecordtable.hpp | 2 +- apps/opencs/view/world/tablesubview.cpp | 4 ++-- apps/opencs/view/world/tablesubview.hpp | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/opencs/view/filter/filterbox.hpp b/apps/opencs/view/filter/filterbox.hpp index 3dcd6ca7e1..bb53b94558 100644 --- a/apps/opencs/view/filter/filterbox.hpp +++ b/apps/opencs/view/filter/filterbox.hpp @@ -53,8 +53,8 @@ namespace CSVFilter signals: void recordFilterChanged(std::shared_ptr filter); - void recordDropped(std::vector& types, std::pair columnSearchData, - Qt::DropAction action); + void recordDropped(std::vector& types, + const std::pair& columnSearchData, Qt::DropAction action); }; } diff --git a/apps/opencs/view/filter/filterdata.hpp b/apps/opencs/view/filter/filterdata.hpp index 4be6499867..b99363712d 100644 --- a/apps/opencs/view/filter/filterdata.hpp +++ b/apps/opencs/view/filter/filterdata.hpp @@ -1,5 +1,5 @@ -#ifndef FILTERDATA_HPP -#define FILTERDATA_HPP +#ifndef CSV_FILTER_FILTERDATA_H +#define CSV_FILTER_FILTERDATA_H #include #include @@ -9,13 +9,11 @@ namespace CSVFilter { - struct FilterData { std::variant searchData; std::vector columns; }; - } -#endif // FILTERDATA_HPP +#endif diff --git a/apps/opencs/view/world/dragrecordtable.cpp b/apps/opencs/view/world/dragrecordtable.cpp index 1ffcd271dc..ae8c1cb708 100644 --- a/apps/opencs/view/world/dragrecordtable.cpp +++ b/apps/opencs/view/world/dragrecordtable.cpp @@ -16,7 +16,7 @@ #include "dragdroputils.hpp" -void CSVWorld::DragRecordTable::startDragFromTable(const CSVWorld::DragRecordTable& table, QModelIndex index) +void CSVWorld::DragRecordTable::startDragFromTable(const CSVWorld::DragRecordTable& table, const QModelIndex& index) { std::vector records = table.getDraggedRecords(); if (records.empty()) diff --git a/apps/opencs/view/world/dragrecordtable.hpp b/apps/opencs/view/world/dragrecordtable.hpp index 614ff5e408..8653c2747f 100644 --- a/apps/opencs/view/world/dragrecordtable.hpp +++ b/apps/opencs/view/world/dragrecordtable.hpp @@ -42,7 +42,7 @@ namespace CSVWorld void setEditLock(bool locked); protected: - void startDragFromTable(const DragRecordTable& table, QModelIndex index); + void startDragFromTable(const DragRecordTable& table, const QModelIndex& index); void dragEnterEvent(QDragEnterEvent* event) override; diff --git a/apps/opencs/view/world/tablesubview.cpp b/apps/opencs/view/world/tablesubview.cpp index 7165722a82..c9e09e2d6a 100644 --- a/apps/opencs/view/world/tablesubview.cpp +++ b/apps/opencs/view/world/tablesubview.cpp @@ -153,8 +153,8 @@ void CSVWorld::TableSubView::cloneRequest(const CSMWorld::UniversalId& toClone) emit cloneRequest(toClone.getId(), toClone.getType()); } -void CSVWorld::TableSubView::createFilterRequest( - std::vector& types, std::pair columnSearchData, Qt::DropAction action) +void CSVWorld::TableSubView::createFilterRequest(std::vector& types, + const std::pair& columnSearchData, Qt::DropAction action) { std::vector sourceFilter; std::vector refIdColumns = mTable->getColumnsWithDisplay( diff --git a/apps/opencs/view/world/tablesubview.hpp b/apps/opencs/view/world/tablesubview.hpp index b6beb08779..967002a93d 100644 --- a/apps/opencs/view/world/tablesubview.hpp +++ b/apps/opencs/view/world/tablesubview.hpp @@ -63,7 +63,7 @@ namespace CSVWorld void editRequest(const CSMWorld::UniversalId& id, const std::string& hint); void cloneRequest(const CSMWorld::UniversalId& toClone); void createFilterRequest(std::vector& types, - std::pair columnSearchData, Qt::DropAction action); + const std::pair& columnSearchData, Qt::DropAction action); void toggleOptions(); public slots: