mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-05 00:02:27 -08:00
Add contextual bar to paste and add move entry
This commit is contained in:
1 parent
5286a60142
commit
9424feefce
13 files changed
+346
-28
No files matched your search
@@ -51,6 +51,9 @@ import java.io.OutputStream;
|
||||
import java.io.SyncFailedException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class Database {
|
||||
@@ -659,6 +662,42 @@ public class Database {
|
||||
}
|
||||
}
|
||||
|
||||
public @Nullable PwEntry copyEntry(PwEntry entryToCopy, PwGroup newParent) {
|
||||
try {
|
||||
// TODO encapsulate
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
case V3:
|
||||
PwEntryV3 entryV3Copied = ((PwEntryV3) entryToCopy).clone();
|
||||
entryV3Copied.setUUID(UUID.randomUUID());
|
||||
entryV3Copied.setParent((PwGroupV3) newParent);
|
||||
return entryV3Copied;
|
||||
case V4:
|
||||
PwEntryV4 entryV4Copied = ((PwEntryV4) entryToCopy).clone();
|
||||
entryV4Copied.setUUID(UUID.randomUUID());
|
||||
entryV4Copied.setParent((PwGroupV4) newParent);
|
||||
return entryV4Copied;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "This version of PwEntry can't be updated", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// TODO copy group
|
||||
public void copyGroup(PwGroup groupToCopy, PwGroup newParent) {
|
||||
|
||||
}
|
||||
|
||||
// TODO move entry
|
||||
public void moveEntry(PwEntry entryToMove, PwGroup newParent) {
|
||||
|
||||
}
|
||||
|
||||
// TODO move group
|
||||
public void moveGroup(PwGroup groupToMove, PwGroup newParent) {
|
||||
|
||||
}
|
||||
|
||||
public void deleteEntry(PwEntry entry) {
|
||||
try {
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
|
||||
Reference in new issue
Block a user