remove property user_defined if none left
authoramwaterhouse <Andrew Waterhouse>
Fri, 19 Aug 2005 08:50:53 +0000 (08:50 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 19 Aug 2005 08:50:53 +0000 (08:50 +0000)
src/jalview/gui/UserDefinedColours.java

index 2182b2c..79df106 100755 (executable)
@@ -551,7 +551,11 @@ public class UserDefinedColours extends GUserDefinedColours
       }\r
       if (!files.equals(coloursFound.toString()))\r
       {\r
-        jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound.toString());\r
+        if (coloursFound.toString().length() > 1)\r
+          jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS",\r
+                                        coloursFound.toString());\r
+        else\r
+          jalview.bin.Cache.applicationProperties.remove("USER_DEFINED_COLOURS");\r
       }\r
     }\r
 \r
@@ -587,7 +591,10 @@ public class UserDefinedColours extends GUserDefinedColours
         }\r
       }\r
 \r
-      jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound.toString());\r
+      if (coloursFound.toString().length() > 1)\r
+        jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound.toString());\r
+      else\r
+        jalview.bin.Cache.applicationProperties.remove("USER_DEFINED_COLOURS");\r
 \r
     }\r
 }\r