
Ben Konrath wrote:
Hi,
I've been studying the mkgmap source for the past couple of days using eclipse and I needed this patch to get it work. Any chance this could be committed? Comments are appreciated.
It seems my patch didn't go through. I've reattached it. Cheers, Ben Index: /home/ben/workspace/mkgmap/.project =================================================================== --- /home/ben/workspace/mkgmap/.project (revision 0) +++ /home/ben/workspace/mkgmap/.project (revision 0) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>mkgmap</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Index: /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java =================================================================== --- /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java (revision 856) +++ /home/ben/workspace/mkgmap/src/uk/me/parabola/mkgmap/osmstyle/StyleFileLoader.java (working copy) @@ -19,6 +19,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.Reader; +import java.net.MalformedURLException; import java.net.URL; import uk.me.parabola.log.Logger; @@ -146,6 +147,13 @@ // all style files must be in the same directory or zip URL url = classLoader.getResource(path); + if (url == null) { + try { + url = new File(System.getProperty("user.dir") + "/resources/" + path).toURI().toURL(); + } catch (MalformedURLException e) { + url = null; + } + } if (url == null) throw new FileNotFoundException("Could not find style " + path); Index: /home/ben/workspace/mkgmap/.classpath =================================================================== --- /home/ben/workspace/mkgmap/.classpath (revision 0) +++ /home/ben/workspace/mkgmap/.classpath (revision 0) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath>