aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknuthy <knuthy@gmail.com>2014-10-01 11:13:40 +0200
committerknuthy <knuthy@gmail.com>2014-10-01 11:13:40 +0200
commit7264494a02f40d840e1296ffd6c1544d4c7d915b (patch)
tree5c48acdc7f0b4cde258472b39a737d201d5f3f98
parentcc2883fe1b99c12f9e40295131c5d8e3ecaf16f9 (diff)
corrected a nasty bug, resolves #18
-rw-r--r--app/app-debug.apkbin1717832 -> 1722187 bytes
-rw-r--r--app/app-release.apkbin1717802 -> 1722048 bytes
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.java8
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java6
4 files changed, 10 insertions, 4 deletions
diff --git a/app/app-debug.apk b/app/app-debug.apk
index e33901e3..bfc43cd3 100644
--- a/app/app-debug.apk
+++ b/app/app-debug.apk
Binary files differ
diff --git a/app/app-release.apk b/app/app-release.apk
index 677e0032..8bc3a101 100644
--- a/app/app-release.apk
+++ b/app/app-release.apk
Binary files differ
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
index 4d3ed8ee..a613b021 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
@@ -98,7 +98,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
return true;
case R.id.menu_add_password:
- if (PasswordRepository.isInitialized()) {
+ if (!PasswordRepository.isInitialized()) {
initBefore.show();
break;
}
@@ -110,7 +110,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
// break;
case R.id.git_push:
- if (PasswordRepository.isInitialized()) {
+ if (!PasswordRepository.isInitialized()) {
initBefore.show();
break;
}
@@ -122,7 +122,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
return true;
case R.id.git_pull:
- if (PasswordRepository.isInitialized()) {
+ if (!PasswordRepository.isInitialized()) {
initBefore.show();
break;
}
@@ -250,12 +250,14 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI
case 0:
if(!localDir.equals(PasswordRepository.getWorkTree()))
break;
+ PasswordRepository.setInitialized(false);
ToCloneOrNot cloneFrag = new ToCloneOrNot();
fragmentTransaction.replace(R.id.main_layout, cloneFrag, "ToCloneOrNot");
fragmentTransaction.commit();
break;
default:
+ PasswordRepository.setInitialized(true);
PasswordFragment passFrag = new PasswordFragment();
Bundle args = new Bundle();
args.putString("Path", localDir.getAbsolutePath());
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
index 3e40d4b9..24a1524c 100644
--- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
+++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java
@@ -38,7 +38,6 @@ public class PasswordRepository {
.readEnvironment()
.findGitDir()
.build();
- initialized = true;
} catch (Exception e) {
e.printStackTrace();
return null;
@@ -51,6 +50,10 @@ public class PasswordRepository {
return initialized;
}
+ public static void setInitialized(boolean v) {
+ initialized = v;
+ }
+
public static void createRepository(File localDir) {
localDir.delete();
@@ -71,6 +74,7 @@ public class PasswordRepository {
.setName("master")
.call();
+ initialized = true;
} catch (Exception e) {
e.printStackTrace();
return;