Mercurial > 510Connectbot
diff src/com/five_ten_sg/connectbot/HostEditorActivity.java @ 308:42b15aaa7ac7 ganymed
merge
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 30 Jul 2014 14:21:50 -0700 |
parents | 071eccdff8ea |
children |
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/HostEditorActivity.java Wed Jul 30 13:38:04 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/HostEditorActivity.java Wed Jul 30 14:21:50 2014 -0700 @@ -323,8 +323,11 @@ // get all the original text summaries for (String key : this.pref.values.keySet()) { Preference pref = this.findPreference(key); + if (pref == null) continue; + if (pref instanceof CheckBoxPreference) continue; + CharSequence value = pref.getSummary(); summaries.put(key, value); } @@ -334,8 +337,11 @@ // for all text preferences, set hint as current database value if it is non-empty for (String key : this.pref.values.keySet()) { Preference pref = this.findPreference(key); + if (pref == null) continue; + if (pref instanceof CheckBoxPreference) continue; + CharSequence value = this.pref.getString(key, ""); if (key.equals(HostDatabase.FIELD_HOST_PUBKEYID)) { @@ -358,10 +364,12 @@ else if ((pref instanceof ListPreference) && (value != null)) { ListPreference listPref = (ListPreference) pref; int entryIndex = listPref.findIndexOfValue(value.toString()); + if (entryIndex >= 0) value = listPref.getEntries()[entryIndex]; } if ((value == null) || (value.length() == 0)) value = summaries.get(key); + pref.setSummary(value); } }