# HG changeset patch # User Carl Byington # Date 1403218735 25200 # Node ID e251b3b679c33ff8a6c12c1cdeac5686248cd60a # Parent 81cafbe7cd9b2c18102d1602b4cbdec85c902b08 read deployment.connections on startup for new host entries diff -r 81cafbe7cd9b -r e251b3b679c3 src/com/five_ten_sg/connectbot/HostListActivity.java --- a/src/com/five_ten_sg/connectbot/HostListActivity.java Thu Jun 19 15:52:16 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/HostListActivity.java Thu Jun 19 15:58:55 2014 -0700 @@ -17,7 +17,6 @@ package com.five_ten_sg.connectbot; -import java.util.List; import com.five_ten_sg.connectbot.bean.HostBean; import com.five_ten_sg.connectbot.service.TerminalBridge; @@ -25,11 +24,16 @@ import com.five_ten_sg.connectbot.transport.TransportFactory; import com.five_ten_sg.connectbot.util.HostDatabase; import com.five_ten_sg.connectbot.util.PreferenceConstants; + +import java.io.BufferedReader; import java.io.File; +import java.util.List; + import android.app.Activity; import android.app.AlertDialog; import android.app.ListActivity; import android.content.ComponentName; +import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -38,6 +42,7 @@ import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.content.res.ColorStateList; +import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -404,7 +409,7 @@ ContentValues values = null; while ((line = reader.readLine()).length() > 0) { String [] parts = line.split("="); - if (parts.length() != 2) continue; + if (parts.length != 2) continue; if (values == null) values = new ContentValues(); values.put(parts[0], parts[1]); } @@ -423,7 +428,7 @@ db.close(); } reader.close(); - File.delete(fn); + (new File(fn)).delete(); } catch (Exception e) { Log.d(TAG, "Deployment scan failed.", e);