Skip to content

Commit

Permalink
Correclty load icons of panels with whitespaces in their name (#1241) (
Browse files Browse the repository at this point in the history
…#1242)

(cherry picked from commit d390a55)

Co-authored-by: Patrick Roncagliolo <ronca.pat@gmail.com>
  • Loading branch information
mergify[bot] and roncapat authored Jul 19, 2024
1 parent 1326f84 commit 6ce58ec
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ class PluginlibFactory : public ClassIdRecordingFactory<Type>
return loadPixmap(default_icon_path);
}

auto base_path = "package://" + info.package + "/icons/classes/" + info.name;
auto encoded_name = info.name;
encoded_name.replace(" ", "%20");
auto base_path = "package://" + info.package + "/icons/classes/" + encoded_name;
QIcon icon = loadPixmap(base_path + ".svg");
if (icon.isNull()) {
icon = loadPixmap(base_path + ".png");
Expand Down

0 comments on commit 6ce58ec

Please sign in to comment.