-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enable compiled-in XPM pixmaps (#4578) #4608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note: CI only failed because of a used |
|
|
Downloads for this pull requestGenerated by the LMMS pull requests bot. |
e0384b8 to
847680c
Compare
PhysSong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. I've suggested some improvements, but I wouldn't bother if you merge this as is.
src/gui/embed.cpp
Outdated
| QImageReader reader(QString("artwork:%1").arg(pixmapName)); | ||
|
|
||
| // xpm strings are not loaded from file, you must use addXpmToCache() | ||
| if (pixmapName.startsWith("xpm:")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be better if this check were before creating a QImageReader instance.
include/embed.h
Outdated
| * @param pixmapName Unique identifier for the XPM. Do *not* prepend "xpm:". | ||
| * @param xpm_data The raw XPM string (*not* a file name). | ||
| */ | ||
| inline void addXpmToCache(const QString& pixmapName, const char** xpm_data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can only be called while a
GuiApplicationis running.
Can we check it in this function and warn if the condition not met?
847680c to
c1d5bde
Compare
Should I merge this to master? It's practical and may help coders in the future, but it's also currently unused code (as it's only inside my osc-plugin branch), so coders have no example about how it must be used.