From ec79aefee5046c68977b9ceaffca9a84eb723d94 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Wed, 30 Oct 2024 18:06:55 +0100 Subject: [PATCH] Place Edge browser userdata directory in metadata space of workspace The userdata directory for the Edge browser is currently placed as an immediate child of the workspace directory (if existing), thus mixing up with actual projects in the workspace. With this change, the directory is placed in the metadata folder of the SWT bundle within the workspace. --- .../Eclipse UI/org/eclipse/ui/internal/Workbench.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java index 5cb4c5cac77..af01dacada6 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java @@ -147,6 +147,7 @@ import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTException; +import org.eclipse.swt.browser.Browser; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.graphics.DeviceData; import org.eclipse.swt.graphics.FontData; @@ -525,9 +526,10 @@ private static void setEdgeDataDirectory(Display display) { return; } try { - URI workspaceLocationURI = workspaceLocation.getURL().toURI(); - display.setData(EDGE_USER_DATA_FOLDER, Paths.get(workspaceLocationURI).toString()); - } catch (URISyntaxException e) { + URI swtMetadataLocationURI = workspaceLocation + .getDataArea(FrameworkUtil.getBundle(Browser.class).getSymbolicName()).toURI(); + display.setData(EDGE_USER_DATA_FOLDER, Paths.get(swtMetadataLocationURI).toString()); + } catch (URISyntaxException | IOException e) { WorkbenchPlugin.log("Invalid workspace location to be set for Edge browser.", e); //$NON-NLS-1$ } }