summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-02-08 17:29:36 +0100
committerArne Schwabe <arne@rfc2549.org>2015-02-08 17:29:36 +0100
commit27b8dec122522b71057c5bf97a9c762305117c11 (patch)
tree8ce53deb55d6ba74bf28adc6a01a154de401ceaa /main/src
parent8a8978d410965983a58beb77220235471e02cb80 (diff)
Fix bug that servers are shared between copies of profiles
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/VpnProfile.java6
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java4
-rwxr-xr-xmain/src/main/res/values/strings.xml1
3 files changed, 9 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
index 088acbbe..1587e2cd 100644
--- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
+++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java
@@ -695,7 +695,11 @@ public class VpnProfile implements Serializable, Cloneable {
protected VpnProfile clone() throws CloneNotSupportedException {
VpnProfile copy = (VpnProfile) super.clone();
copy.mUuid = UUID.randomUUID();
- copy.mConnections = mConnections.clone();
+ copy.mConnections = new Connection[mConnections.length];
+ int i=0;
+ for (Connection conn: mConnections) {
+ copy.mConnections[i++]=conn.clone();
+ }
copy.mAllowedAppsVpn = (HashSet<String>) mAllowedAppsVpn.clone();
return copy;
}
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
index 01352916..e15fe509 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
@@ -256,8 +256,10 @@ public class VPNProfileList extends ListFragment {
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
if (mCopyProfile == null)
dialog.setTitle(R.string.menu_add_profile);
- else
+ else {
dialog.setTitle(context.getString(R.string.duplicate_profile_title, mCopyProfile.mName));
+ entry.setText(getString(R.string.copy_of_profile, mCopyProfile.mName));
+ }
dialog.setMessage(R.string.add_profile_name_prompt);
dialog.setView(entry);
diff --git a/main/src/main/res/values/strings.xml b/main/src/main/res/values/strings.xml
index fd39aa99..c7529049 100755
--- a/main/src/main/res/values/strings.xml
+++ b/main/src/main/res/values/strings.xml
@@ -365,5 +365,6 @@
<string name="ab_proxy_title">Proxy behaviour for VPNs</string>
<string name="ab_lollipop_reinstall_title">Reinstalling VPN apps</string>
<string name="version_upto">%s and earlier</string>
+ <string name="copy_of_profile">Copy of %s</string>
</resources>