From 94c4ba1f1567446153b205cc490126c70391f515 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 9 Nov 2024 00:46:52 +0100 Subject: [PATCH] Gui: Fix some linter warnings --- src/Gui/TaskElementColors.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Gui/TaskElementColors.cpp b/src/Gui/TaskElementColors.cpp index 1de8f25611ebd..82a55496638d5 100644 --- a/src/Gui/TaskElementColors.cpp +++ b/src/Gui/TaskElementColors.cpp @@ -75,10 +75,10 @@ class ElementColors::Private: public Gui::SelectionGate explicit Private(ViewProviderDocumentObject* vp, const char* element = "") : ui(new Ui_TaskElementColors()) , vp(vp) + , vpParent(vp) + , vpDoc(vp->getDocument()) , editElement(element) { - vpDoc = vp->getDocument(); - vpParent = vp; auto doc = Application::Instance->editDocument(); if (doc) { auto editVp = doc->getInEdit(&vpParent, &editSub); @@ -164,7 +164,7 @@ class ElementColors::Private: public Gui::SelectionGate } for (auto& v : vp->getElementColors(sub)) { - auto it = elements.find(v.first.c_str()); + auto it = elements.find(v.first); if (it != elements.end()) { if (push) { items.push_back(it->second); @@ -195,10 +195,9 @@ class ElementColors::Private: public Gui::SelectionGate for (int i = 0; i < count; ++i) { auto item = ui->elementList->item(i); auto color = item->data(Qt::UserRole).value(); - std::string sub = qPrintable(item->data(Qt::UserRole + 1).value()); info.emplace( qPrintable(item->data(Qt::UserRole + 1).value()), - App::Color(color.redF(), color.greenF(), color.blueF(), 1.0 - color.alphaF())); + App::Color(color.redF(), color.greenF(), color.blueF(), 1.0F - color.alphaF())); } if (!App::GetApplication().getActiveTransaction()) { App::GetApplication().setActiveTransaction("Set colors"); @@ -622,8 +621,9 @@ TaskElementColors::~TaskElementColors() = default; void TaskElementColors::open() {} -void TaskElementColors::clicked(int) +void TaskElementColors::clicked(int id) { + Q_UNUSED(id) } bool TaskElementColors::accept()