Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
getIconPixmap
can now be an absolute file path, to reference a file rather than embedded data.PluginPixmapLoader::pixmapName
now returns the actual resource name (asPixmapLoader
already did), so passing that value togetIconPixmap
will produce the same results as callingPluginPixmapLoader::pixmap
.std::string_view
orstd::string
instead ofQString
. 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, likegetIconPixmap
.I have also done some general cleanup and improvements to the code.