Skip to content
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

Add static appimage get type #112

Merged
merged 3 commits into from
May 9, 2019
Merged

Conversation

azubieta
Copy link
Contributor

@azubieta azubieta commented May 9, 2019

Adds an static version of AppImage::getFormat.

This is useful for the case in which such method is used only to test whether a given file is an AppImage or not.

@azubieta azubieta requested a review from TheAssassin May 9, 2019 21:15
@TheAssassin
Copy link
Member

Isn't that a bit redundant? I thought we already had a getType or so.

@azubieta
Copy link
Contributor Author

azubieta commented May 9, 2019

Isn't that a bit redundant? ? I thought we already had a getType or so

We do have AppImageFormat getFormat() const;, but it's not 'static' and requires an 'AppImage' object to be created. Which is unpractical in the case where only we want to test where a given file is an AppImage or not.

This also implies a performance improvement on appimage_get_type which relies on this feature. In the current implementation it has to create/allocate an AppImage instance just to get the type value.

Copy link
Member

@TheAssassin TheAssassin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Looks good.

@TheAssassin TheAssassin merged commit 352e8a9 into master May 9, 2019
@TheAssassin TheAssassin deleted the add_static_appimage_getType branch May 9, 2019 22:07
@TheAssassin
Copy link
Member

Thanks!

@azubieta
Copy link
Contributor Author

azubieta commented May 9, 2019

Mind to spin a new release for appimaged to receive this changes.

@probonopd
Copy link
Member

Mind to spin a new release for appimaged to receive this changes.

This is why a want a monorepo, to avoid this kind of manual work that is annoying me.

probonopd added a commit to AppImageCommunity/appimaged that referenced this pull request May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants