changeset 198:a9fb5061cca3

read deployment.connections on startup for global preferences also
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 18:46:17 -0700
parents e762997c3911
children 33928f24b40d
files src/com/five_ten_sg/connectbot/HostListActivity.java
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/HostListActivity.java	Wed Jul 02 18:34:49 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/HostListActivity.java	Wed Jul 02 18:46:17 2014 -0700
@@ -145,9 +145,9 @@
         if (requestCode == REQUEST_EULA) {
             if (resultCode == Activity.RESULT_OK) {
                 // yay they agreed, so store that info
-                Editor edit = prefs.edit();
-                edit.putBoolean(PreferenceConstants.EULA, true);
-                edit.commit();
+                Editor editor = prefs.edit();
+                editor.putBoolean(PreferenceConstants.EULA, true);
+                editor.commit();
             }
             else {
                 // user didnt agree, so close
@@ -461,19 +461,23 @@
                             char stype = types.get(key).charAt(0);
                             switch (stype) {
                                 case 'b':
-                                    editor.putBoolean(key, values.getAsBoolean(key));
+                                    boolean bv = values.getAsBoolean(key);
+                                    editor.putBoolean(key, bv);
                                     break;
 
                                 case 'i':
-                                    editor.putInt(key, values.getAsInteger(key));
+                                    int iv = values.getAsInteger(key);
+                                    editor.putInt(key, iv);
                                     break;
 
                                 case 'f':
-                                    editor.putFloat(key, values.getAsFloat(key));
+                                    float fv = values.getAsFloat(key);
+                                    editor.putFloat(key, fv);
                                     break;
 
                                 case 's':
-                                    editor.putString(key, values.getAsString(key));
+                                    String sv = values.getAsString(key);
+                                    editor.putString(key, sv);
                                     break;
                             }
                         }
@@ -506,9 +510,9 @@
 
     protected void updateList() {
         if (prefs.getBoolean(PreferenceConstants.SORT_BY_COLOR, false) != sortedByColor) {
-            Editor edit = prefs.edit();
-            edit.putBoolean(PreferenceConstants.SORT_BY_COLOR, sortedByColor);
-            edit.commit();
+            Editor editor = prefs.edit();
+            editor.putBoolean(PreferenceConstants.SORT_BY_COLOR, sortedByColor);
+            editor.commit();
         }
 
         if (hostdb == null)