OSDN Git Service

コンフィグ設定画面でコンフィグを設定した場合、マイリストの設定値が壊れる問題に対応.
authoryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Mon, 30 Nov 2009 16:55:18 +0000 (16:55 +0000)
committeryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Mon, 30 Nov 2009 16:55:18 +0000 (16:55 +0000)
git-svn-id: http://192.168.11.7/svn/repository/NicoBrowser/trunk@247 bdf3b611-c98c-6041-8292-703d9c9adbe7

src/nicobrowser/Config.java
src/nicobrowser/main/Main.java

index 544a046..626b51a 100644 (file)
@@ -110,7 +110,7 @@ public final class Config {
         updatePropertyValue(p, P_DOWNLOAD_RETRY);
         updatePropertyValue(p, P_DOWNLOAD_WAIT);
 
-        updatePropertyValue(p, P_DOWNLOAD_MYLIST);
+        updatePropertyValueArray(p, P_DOWNLOAD_MYLIST);
 
         try {
             properties.save();
@@ -129,6 +129,14 @@ public final class Config {
         properties.setProperty(key, value);
     }
 
+    private void updatePropertyValueArray(Configuration newProp, String key) {
+        String[] values = newProp.getStringArray(key);
+        if (values.length < 1) {
+            values = properties.getStringArray(key);
+        }
+        properties.setProperty(key, values);
+    }
+
     private static void createNewConfigFile(File file) throws IOException {
         ArrayList<CharSequence> props = new ArrayList<CharSequence>();
 
index aaca44b..9c2e16f 100644 (file)
@@ -34,7 +34,7 @@ import org.apache.commons.logging.LogFactory;
 
 public class Main {
 
-    public static final String VERSION = "version 0.3.0";
+    public static final String VERSION = "version 0.3.1";
     private static Log log = LogFactory.getLog(Main.class);
 
     public static void main(String[] args) throws IOException {