summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-11-29 19:15:58 +0100
committerArne Schwabe <arne@rfc2549.org>2013-11-29 19:15:58 +0100
commitd5e947f2dd9ba93a4bb6a801d0ef8ad21d43d8d2 (patch)
tree047e89df785e68c0de0abc688e56bcec2df57226
parentdd9c8a6b22d9ef11c11a6e38de82d80657258b9e (diff)
Fix empty profile when importing from a content provider
-rw-r--r--icsopenvpn.iml8
-rw-r--r--src/de/blinkt/openvpn/ConfigConverter.java7
2 files changed, 9 insertions, 6 deletions
diff --git a/icsopenvpn.iml b/icsopenvpn.iml
index c0ba6aa7..ad327925 100644
--- a/icsopenvpn.iml
+++ b/icsopenvpn.iml
@@ -23,10 +23,10 @@
<output url="file://$MODULE_DIR$/build/classes/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
- <sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" />
- <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/build/source/r/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/source/aidl/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" generated="true" />
+ <sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test" isTestSource="true" />
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java
index 75620455..d0782a8a 100644
--- a/src/de/blinkt/openvpn/ConfigConverter.java
+++ b/src/de/blinkt/openvpn/ConfigConverter.java
@@ -188,7 +188,7 @@ public class ConfigConverter extends ListActivity {
if(mResult.mName!=null && !ConfigParser.CONVERTED_PROFILE.equals(mResult.mName))
newname=mResult.mName;
- while(vpl.getProfileByName(newname)!=null) {
+ while(newname==null || vpl.getProfileByName(newname)!=null) {
i++;
if(i==1)
newname = getString(R.string.converted_profile);
@@ -368,7 +368,10 @@ public class ConfigConverter extends ListActivity {
//log(R.string.import_experimental);
log(R.string.importing_config,data.toString());
try {
- if(data.getScheme().equals("file")) {
+ if(data.getScheme().equals("file") ||
+ data.getLastPathSegment().endsWith(".ovpn") ||
+ data.getLastPathSegment().endsWith(".conf"))
+ {
mPossibleName = data.getLastPathSegment();
if(mPossibleName!=null){
mPossibleName =mPossibleName.replace(".ovpn", "");