Skip to content

Commit

Permalink
Merge pull request FreeCAD#14000 from wwmayer/td_fix_warning
Browse files Browse the repository at this point in the history
TD: Fix several compiler warnings
  • Loading branch information
WandererFan committed May 14, 2024
2 parents 869cb1f + c7532cf commit cf57d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/Mod/TechDraw/Gui/MDIViewPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,10 @@ void MDIViewPage::setTreeToSceneSelect()
auto* vert = dynamic_cast<QGIVertex*>(scene);
auto* face = dynamic_cast<QGIFace*>(scene);
if (edge || vert || face) {
const char* ssn = getSceneSubName(scene).c_str();
std::string ssn = getSceneSubName(scene);

Gui::Selection().addSelection(doc_name, obj_name, ssn);
showStatusMsg(doc_name, obj_name, ssn);
Gui::Selection().addSelection(doc_name, obj_name, ssn.c_str());
showStatusMsg(doc_name, obj_name, ssn.c_str());
return;
}
else if (dynamic_cast<QGIDatumLabel*>(scene) || dynamic_cast<QGMText*>(scene)) {
Expand Down Expand Up @@ -846,8 +846,6 @@ std::string MDIViewPage::getSceneSubName(QGraphicsItem* scene)
if (edge || vert || face) {
auto* viewItem = dynamic_cast<QGIView*>(scene->parentItem());
if (viewItem) {
TechDraw::DrawView* viewObj = viewItem->getViewObject();

std::stringstream ss;
if (edge) { ss << "Edge" << edge->getProjIndex(); }
else if (vert) { ss << "Vertex" << vert->getProjIndex(); }
Expand All @@ -860,7 +858,7 @@ std::string MDIViewPage::getSceneSubName(QGraphicsItem* scene)
}

// adds scene to core selection if it's not in already.
void MDIViewPage::addSceneToTreeSel(QGraphicsItem* sn, std::vector<Gui::SelectionObject> treeSel)
void MDIViewPage::addSceneToTreeSel(QGraphicsItem* sn, [[maybe_unused]]std::vector<Gui::SelectionObject> treeSel)
{
auto* itemView = dynamic_cast<QGIView*>(sn);
if (!itemView) {
Expand Down Expand Up @@ -955,7 +953,6 @@ void MDIViewPage::removeSelFromTreeSel(QList<QGraphicsItem*> sceneSel, Gui::Sele
TechDraw::DrawView* viewObj = itemView->getViewObject();
if (viewObj && !viewObj->isRemoving()) {
const char* doc_name = viewObj->getDocument()->getName();
const char* obj_name = viewObj->getNameInDocument();

if (selDocName == doc_name && selObj == viewObj) {
found = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/TechDrawHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void TechDrawHandler::deactivate()
// The context menu event of MDIViewPage comes after the tool is deactivated.
// So to prevent the menu from appearing when the tool is cleared by right mouse click
// we set a small timer.
QTimer::singleShot(100, [this]() { // 100 milliseconds delay
QTimer::singleShot(100, []() { // 100 milliseconds delay
auto* mdi = dynamic_cast<MDIViewPage*>(Gui::getMainWindow()->activeWindow());
if (!mdi) {
return;
Expand Down

0 comments on commit cf57d0a

Please sign in to comment.