diff --git a/src/blackgui/models/airportlistmodel.h b/src/blackgui/models/airportlistmodel.h index 8e4072fe6..8fee63187 100644 --- a/src/blackgui/models/airportlistmodel.h +++ b/src/blackgui/models/airportlistmodel.h @@ -11,10 +11,10 @@ #ifndef BLACKGUI_MODELS_AIRPORTLISTMODEL_H #define BLACKGUI_MODELS_AIRPORTLISTMODEL_H -#include "blackgui/blackguiexport.h" #include "blackgui/models/listmodelbase.h" -#include "blackmisc/aviation/airport.h" +#include "blackgui/blackguiexport.h" #include "blackmisc/aviation/airportlist.h" +#include "blackmisc/aviation/airport.h" class QObject; diff --git a/src/blackgui/models/listmodelbase.cpp b/src/blackgui/models/listmodelbase.cpp index bd1845cc0..4549cc695 100644 --- a/src/blackgui/models/listmodelbase.cpp +++ b/src/blackgui/models/listmodelbase.cpp @@ -35,17 +35,17 @@ namespace BlackGui template int CListModelBase::rowCount(const QModelIndex &parentIndex) const { - Q_UNUSED(parentIndex); + Q_UNUSED(parentIndex) return this->containerOrFilteredContainer().size(); } template bool CListModelBase::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const { - Q_UNUSED(action); - Q_UNUSED(row); - Q_UNUSED(column); - Q_UNUSED(parent); + Q_UNUSED(action) + Q_UNUSED(row) + Q_UNUSED(column) + Q_UNUSED(parent) if (!this->isDropAllowed()) { return false; } if (!this->acceptDrop(data)) { return false; } return true; @@ -54,8 +54,8 @@ namespace BlackGui template bool CListModelBase::dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) { - Q_UNUSED(row); - Q_UNUSED(column); + Q_UNUSED(row) + Q_UNUSED(column) if (!this->isOrderable() || !this->acceptDrop(mimeData)) { return false; } const CVariant valueVariant(this->toCVariant(mimeData)); @@ -191,7 +191,8 @@ namespace BlackGui } const int newSize = m_container.size(); - Q_UNUSED(oldSize); + Q_UNUSED(oldSize) + // I have to update even with same size because I cannot tell what/if data are changed this->emitModelDataChanged(); return newSize; @@ -218,7 +219,7 @@ namespace BlackGui template CWorker *CListModelBase::updateAsync(const ContainerType &container, bool sort) { - Q_UNUSED(sort); + Q_UNUSED(sort) if (m_modelDestroyed) { return nullptr; } const auto sortColumn = this->getSortColumn(); const auto sortOrder = this->getSortOrder(); @@ -474,9 +475,9 @@ namespace BlackGui void CListModelBase::onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles) { // underlying base class changed - Q_UNUSED(topLeft); - Q_UNUSED(bottomRight); - Q_UNUSED(roles); + Q_UNUSED(topLeft) + Q_UNUSED(bottomRight) + Q_UNUSED(roles) this->emitModelDataChanged(); } @@ -492,8 +493,8 @@ namespace BlackGui void CListModelBase::moveItems(const ContainerType &items, int position) { // overridden in specialized class - Q_UNUSED(items); - Q_UNUSED(position); + Q_UNUSED(items) + Q_UNUSED(position) } template diff --git a/src/blackgui/models/listmodelbase.h b/src/blackgui/models/listmodelbase.h index 41f8059e0..c89732a8a 100644 --- a/src/blackgui/models/listmodelbase.h +++ b/src/blackgui/models/listmodelbase.h @@ -44,7 +44,7 @@ namespace BlackGui using ObjectType = typename T::value_type; //! Destructor - virtual ~CListModelBase() {} + virtual ~CListModelBase() override {} //! \name Functions from QStandardItemModel //! @{ @@ -222,4 +222,5 @@ namespace BlackGui } // namespace } // namespace } // namespace + #endif // guard diff --git a/src/blackgui/models/listmodelbasenontemplate.cpp b/src/blackgui/models/listmodelbasenontemplate.cpp index 57a6b8f92..d191c4e91 100644 --- a/src/blackgui/models/listmodelbasenontemplate.cpp +++ b/src/blackgui/models/listmodelbasenontemplate.cpp @@ -9,25 +9,8 @@ // Drag and drop docu: // http://doc.qt.io/qt-5/model-view-programming.html#using-drag-and-drop-with-item-views -//#include "blackgui/models/columnformatters.h" #include "blackgui/models/listmodelbasenontemplate.h" -//#include "blackgui/models/allmodelcontainers.h" -//#include "blackgui/guiutility.h" -//#include "blackmisc/compare.h" -//#include "blackmisc/predicates.h" -//#include "blackmisc/propertyindex.h" -//#include "blackmisc/fileutils.h" -//#include "blackmisc/sequence.h" -//#include "blackmisc/variant.h" #include "blackmisc/verify.h" -//#include "blackmisc/worker.h" - -//#include -//#include -//#include -//#include -//#include -//#include using namespace BlackMisc; @@ -37,7 +20,7 @@ namespace BlackGui { int CListModelBaseNonTemplate::columnCount(const QModelIndex &modelIndex) const { - Q_UNUSED(modelIndex); + Q_UNUSED(modelIndex) int c = m_columns.size(); return c; } @@ -62,13 +45,13 @@ namespace BlackGui QModelIndex CListModelBaseNonTemplate::index(int row, int column, const QModelIndex &parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent) return QStandardItemModel::createIndex(row, column); } QModelIndex CListModelBaseNonTemplate::parent(const QModelIndex &child) const { - Q_UNUSED(child); + Q_UNUSED(child) return QModelIndex(); } diff --git a/src/blackmisc/network/ecosystem.cpp b/src/blackmisc/network/ecosystem.cpp index 3f020394b..c100c2dbf 100644 --- a/src/blackmisc/network/ecosystem.cpp +++ b/src/blackmisc/network/ecosystem.cpp @@ -111,11 +111,11 @@ namespace BlackMisc int CEcosystem::comparePropertyByIndex(const CPropertyIndex &index, const CEcosystem &compareValue) const { - if (index.isMyself()) { return Compare::compare(this->m_system, compareValue.m_system); } + if (index.isMyself()) { return Compare::compare(m_system, compareValue.m_system); } const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexSystem: return Compare::compare(this->m_system, compareValue.m_system); + case IndexSystem: return Compare::compare(m_system, compareValue.m_system); default: break; } BLACK_VERIFY_X(false, Q_FUNC_INFO, qUtf8Printable("No comparison for index " + index.toQString())); diff --git a/src/blackmisc/network/ecosystem.h b/src/blackmisc/network/ecosystem.h index 88023c354..e0a3d0fd4 100644 --- a/src/blackmisc/network/ecosystem.h +++ b/src/blackmisc/network/ecosystem.h @@ -75,7 +75,7 @@ namespace BlackMisc //! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant); - //! Compare by index + //! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex int comparePropertyByIndex(const CPropertyIndex &index, const CEcosystem &compareValue) const; //! \copydoc BlackMisc::Mixin::String::toQString