Author: timotei
Date: Mon Aug  1 20:52:57 2011
New Revision: 50536

URL: http://svn.gna.org/viewcvs/wesnoth?rev=50536&view=rev
Log:
eclipse plugin: Some cleanups

Modified:
    trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/Constants.java
    
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/installs/WesnothInstallsUtils.java

Modified: trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/Constants.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/Constants.java?rev=50536&r1=50535&r2=50536&view=diff
==============================================================================
--- trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/Constants.java (original)
+++ trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/Constants.java Mon Aug  1 
20:52:57 2011
@@ -22,18 +22,18 @@
                
Constants.class.getProtectionDomain().getCodeSource().getLocation().getPath() + 
"/"; //$NON-NLS-1$
        public static final String PLUGIN_ID  = "org.wesnoth"; //$NON-NLS-1$
 
+    public static final String MACHINE_OS =
+        System.getProperty("os.name").toLowerCase(Locale.ENGLISH); 
//$NON-NLS-1$
        /**
         * The boolean value whether this machine is running windows or not
         */
        public static final boolean IS_WINDOWS_MACHINE =
-               
System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); 
//$NON-NLS-1$ //$NON-NLS-2$
+               MACHINE_OS.contains("windows"); //$NON-NLS-1$ //$NON-NLS-2$
        /**
         * The boolean value whether this machine is running Machintosh or not
         */
        public static final boolean IS_MAC_MACHINE =
-               
System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac"); 
//$NON-NLS-1$ //$NON-NLS-2$
-       public static final String MACHINE_OS =
-               System.getProperty("os.name").toLowerCase(Locale.ENGLISH); 
//$NON-NLS-1$
+               MACHINE_OS.contains("mac"); //$NON-NLS-1$ //$NON-NLS-2$
 
        /** Preferences Constants **/
        public static final String      P_WESNOTH_EXEC_PATH     = 
"wesnoth_exec_path"; //$NON-NLS-1$

Modified: 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/installs/WesnothInstallsUtils.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/installs/WesnothInstallsUtils.java?rev=50536&r1=50535&r2=50536&view=diff
==============================================================================
--- 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/installs/WesnothInstallsUtils.java
 (original)
+++ 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/installs/WesnothInstallsUtils.java
 Mon Aug  1 20:52:57 2011
@@ -22,6 +22,7 @@
 import org.wesnoth.preferences.Preferences;
 import org.wesnoth.projects.ProjectUtils;
 import org.wesnoth.utils.GUIUtils;
+import org.wesnoth.utils.StringUtils;
 import org.wesnoth.utils.WorkspaceUtils;
 
 public class WesnothInstallsUtils
@@ -79,6 +80,9 @@
      */
     public static String getInstallNameForResource( String resourcePath )
     {
+        if ( StringUtils.isNullOrEmpty( resourcePath ) )
+            return "";
+
         return getInstallNameForResource( ResourcesPlugin.getWorkspace( 
).getRoot( ).
                 findMember( resourcePath ) );
     }
@@ -90,7 +94,7 @@
      */
     public static String getInstallNameForResource( IResource resource )
     {
-        if ( resource == null )
+        if ( resource == null || ! resource.exists( ) )
             return ""; //$NON-NLS-1$
 
         return ProjectUtils.getCacheForProject( resource.getProject( ) 
).getInstallName( );


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to