Skip to content

Commit

Permalink
Scripting: Allow referencing built-in icons from Action.icon
Browse files Browse the repository at this point in the history
See also 4b3ef42.
  • Loading branch information
bjorn committed Jul 6, 2023
1 parent d691d52 commit c61c3fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/tiled/scriptedaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "scriptedaction.h"

#include "scriptmanager.h"
#include "utils.h"

#include <QJSEngine>

Expand Down Expand Up @@ -62,7 +61,7 @@ void ScriptedAction::setIconFileName(const QString &fileName)
QString iconFile = fileName;

const QString ext = QStringLiteral("ext:");
if (!iconFile.startsWith(ext))
if (!iconFile.startsWith(ext) && !iconFile.startsWith(QLatin1Char(':')))
iconFile.prepend(ext);

setIcon(QIcon { iconFile });
Expand Down
2 changes: 1 addition & 1 deletion src/tiled/scriptedtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ void ScriptedTool::setIconFileName(const QString &fileName)
QString iconFile = fileName;

const QString ext = QStringLiteral("ext:");
if (!iconFile.startsWith(ext) && !iconFile.startsWith(QLatin1String(":")))
if (!iconFile.startsWith(ext) && !iconFile.startsWith(QLatin1Char(':')))
iconFile.prepend(ext);

setIcon(QIcon { iconFile });
Expand Down

0 comments on commit c61c3fd

Please sign in to comment.