Skip to content

Commit

Permalink
Place Edge browser userdata directory in metadata space of workspace
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HeikoKlare committed Nov 1, 2024
1 parent 1170414 commit 117649f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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$
}
}
Expand Down

0 comments on commit 117649f

Please sign in to comment.