lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Revamp resource embedding

Open DomClark opened this issue 1 year ago • 0 comments

This doesn't offer any immediate benefits, but is part of the work I'm doing towards a plugin manager and scanning system. I've separated it out into its own PR for easier reviewing, since it stands well on its own anyway.

The main changes that are relevant to my other work are these:

  • The resource name passed to getIconPixmap can now be an absolute file path, to reference a file rather than embedded data.
  • PluginPixmapLoader::pixmapName now returns the actual resource name (as PixmapLoader already did), so passing that value to getIconPixmap will produce the same results as calling PluginPixmapLoader::pixmap.
  • The various resource functions and classes now take std::string_view or std::string instead of QString. The vast majority of calls to these pass string literals, so this has no effect in most cases. However, it helps reduce unnecessary Qt usage, and makes it simpler to use with standard library strings in the future.

Other noteable changes:

  • PluginPixmapLoader can take XPM data too.
  • PixmapLoader::pixmap now takes optional width and height parameters, like getIconPixmap.
  • XPM data can now be entirely const.

I have also done some general cleanup and improvements to the code.

DomClark avatar May 06 '24 20:05 DomClark