Commit f0033bec authored by VESIN Marc's avatar VESIN Marc
Browse files

misc: static_cast is enough in these cases, replace dynamic_cast

parent 01f0e727
Pipeline #209905 passed with stage
in 0 seconds
......@@ -148,7 +148,7 @@ dtkWidgetsMenuItem *dtkWidgetsMenu::addItem(dtkWidgetsMenuItem *item)
if (!d->object_hash.contains(item->title())) {
d->object_hash.insert(item->title(), item);
if (item->isParameter()) {
dtkWidgetsMenuItemParameter *item_param = dynamic_cast<dtkWidgetsMenuItemParameter *>(item);
dtkWidgetsMenuItemParameter *item_param = static_cast<dtkWidgetsMenuItemParameter *>(item);
d->object_hash_uid.insert(item_param->parameter()->uid(), item);
} else {
d->object_hash_uid.insert(item->title(), item);
......@@ -183,7 +183,7 @@ dtkWidgetsMenuItem *dtkWidgetsMenu::insertItem(int pos, dtkWidgetsMenuItem *item
if ( !d->object_hash.contains(item->title()) ) {
d->object_hash.insert(item->title(), item);
if (item->isParameter()) {
dtkWidgetsMenuItemParameter *item_param = dynamic_cast<dtkWidgetsMenuItemParameter *>(item);
dtkWidgetsMenuItemParameter *item_param = static_cast<dtkWidgetsMenuItemParameter *>(item);
d->object_hash_uid.insert(item_param->parameter()->uid(), item);
} else {
d->object_hash_uid.insert(item->title(), item);
......@@ -251,7 +251,7 @@ void dtkWidgetsMenu::removeItem(dtkWidgetsMenuItem *item)
QString title;
if (item->isParameter())
title = (dynamic_cast<dtkWidgetsMenuItemParameter *>(item))->parameter()->uid();
title = (static_cast<dtkWidgetsMenuItemParameter *>(item))->parameter()->uid();
else
title = item->title();
if(d->object_hash_uid.contains(title))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment