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

Product file editor: Support for <bundleUrlTypes> on macOS #1326

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

sratz
Copy link
Contributor

@sratz sratz commented Jul 9, 2024

Support editing of entries in the product editor.

These are translated to CFBundleURLTypes entries in the Info.plist dictionary of the macOS app bundle.

Contributes to
eclipse-platform/eclipse.platform.ui#1901.

image

image

Copy link

github-actions bot commented Jul 9, 2024

Test Results

   285 files  ±0     285 suites  ±0   46m 14s ⏱️ - 4m 45s
 3 580 tests  - 1   3 504 ✅ ±0   76 💤 ±0  0 ❌ ±0 
10 932 runs   - 1  10 701 ✅ ±0  231 💤 ±0  0 ❌ ±0 

Results for commit ad53e00. ± Comparison against base commit edf6f1b.

This pull request removes 1 test.
[7: View contribution using 3.x API] ‑ Unknown test

♻️ This comment has been updated with latest results.

Support editing of <launcher><macosx><bundleUrlTypes> entries in the
product editor.

These are translated to CFBundleURLTypes entries in the Info.plist
dictionary of the macOS app bundle.

Contributes to
eclipse-platform/eclipse.platform.ui#1901.
Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

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

Thanks @sratz for your patience, I now reviewed this change in detail and in general it looks good.
I think LauncherInfo.removeMacBundleUrlTypes() was not completely correct although it would probably not have been completely dysfunctional.
I pushed a fix to your branch together with multiple other minor clean-ups. In references to them: There is a lot of old code in the area of the editors but I see no need to copy the old style in new code. :)

If you are fine with the changes I'll submit this tomorrow.

Comment on lines +261 to +269
public void removeMacBundleUrlTypes(List<IMacBundleUrlType> bundleUrlTypes) {
IProductObject[] removedUrlSchemes = bundleUrlTypes.stream() //
.map(IMacBundleUrlType::getScheme).map(fMacBundleUrlTypes::remove) //
.filter(Objects::nonNull).toArray(IProductObject[]::new);

if (removedUrlSchemes.length > 0 && isEditable()) {
fireStructureChanged(removedUrlSchemes, IModelChangedEvent.REMOVE);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

The original logic in this case seems not to be correct since it is attempted twice to remove the scheme from the fMacBundleUrlTypes map?
Did you intend to send an event for the list of schemes passed and the list of schemes actually removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this! You are right, this was definitely not intended. I accidentally took Product#removePlugins() as a template, but that of course has different semantics (removing a plugin also removes its configuration).

@sratz
Copy link
Contributor Author

sratz commented Aug 12, 2024

Thanks @sratz for your patience, I now reviewed this change in detail and in general it looks good. I think LauncherInfo.removeMacBundleUrlTypes() was not completely correct although it would probably not have been completely dysfunctional. I pushed a fix to your branch together with multiple other minor clean-ups. In references to them: There is a lot of old code in the area of the editors but I see no need to copy the old style in new code. :)

Thanks a lot for the review and the improvements to the code!

If you are fine with the changes I'll submit this tomorrow.

We just tested the PDE code end-to-end again and everything looks good! So this can be merged 👍

@merks
Copy link
Contributor

merks commented Aug 12, 2024

Nice teamwork.

@HannesWell
Copy link
Member

If you are fine with the changes I'll submit this tomorrow.

We just tested the PDE code end-to-end again and everything looks good! So this can be merged 👍

Awesome, thanks for checking it again. Then lets have this.

@HannesWell HannesWell merged commit 9b87c23 into eclipse-pde:master Aug 12, 2024
17 checks passed
sratz added a commit to sratz/eclipse.pde that referenced this pull request Aug 20, 2024
sratz added a commit to sratz/eclipse.pde that referenced this pull request Aug 21, 2024
sratz added a commit to sratz/eclipse.pde that referenced this pull request Oct 16, 2024
Corner case (no <launcher> element present, yet) was missed in eclipse-pde#1326.

Fixes eclipse-pde#1443.
HannesWell pushed a commit that referenced this pull request Oct 16, 2024
Corner case (no <launcher> element present, yet) was missed in #1326.

Fixes #1443.
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.

4 participants