fixes an issue where the password was always added on the root
This commit is contained in:
parent
005f0b6b7b
commit
64481bcb45
2 changed files with 18 additions and 2 deletions
|
@ -186,6 +186,17 @@ public class PasswordFragment extends Fragment{
|
||||||
pathStack.pop();
|
pathStack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets the current directory
|
||||||
|
* @return the current directory
|
||||||
|
*/
|
||||||
|
public File getCurrentDir() {
|
||||||
|
if (pathStack.isEmpty())
|
||||||
|
return PasswordRepository.getWorkTree();
|
||||||
|
else
|
||||||
|
return pathStack.peek();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isNotEmpty() {
|
public boolean isNotEmpty() {
|
||||||
return !passListStack.isEmpty();
|
return !passListStack.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,7 +359,7 @@ public class PasswordStore extends ActionBarActivity {
|
||||||
try {
|
try {
|
||||||
Intent intent = new Intent(this, PgpHandler.class);
|
Intent intent = new Intent(this, PgpHandler.class);
|
||||||
intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id")));
|
intent.putExtra("PGP-ID", FileUtils.readFileToString(PasswordRepository.getFile("/.gpg-id")));
|
||||||
intent.putExtra("FILE_PATH", this.currentDir.getAbsolutePath());
|
intent.putExtra("FILE_PATH", getCurrentDir().getAbsolutePath());
|
||||||
intent.putExtra("Operation", "ENCRYPT");
|
intent.putExtra("Operation", "ENCRYPT");
|
||||||
startActivityForResult(intent, PgpHandler.REQUEST_CODE_ENCRYPT);
|
startActivityForResult(intent, PgpHandler.REQUEST_CODE_ENCRYPT);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -429,7 +429,12 @@ public class PasswordStore extends ActionBarActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private File getCurrentDir() {
|
private File getCurrentDir() {
|
||||||
return new File(((PasswordFragment) getFragmentManager().findFragmentByTag("PasswordsList")).getArguments().getString("Path"));
|
PasswordFragment plist;
|
||||||
|
if (null !=
|
||||||
|
(plist = (PasswordFragment) getFragmentManager().findFragmentByTag("PasswordsList"))) {
|
||||||
|
return plist.getCurrentDir();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode,
|
protected void onActivityResult(int requestCode, int resultCode,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue