Clear rules with transaction

pull/184/head
M66B 5 years ago
parent fb2347c8c0
commit f1627e758b

@ -456,12 +456,12 @@ public class FragmentRules extends FragmentBase {
boolean all = args.getBoolean("all");
DB db = DB.getInstance(context);
try {
db.beginTransaction();
if (all) {
if (all)
db.rule().deleteRules(fid);
return null;
}
else {
EntityFolder folder = db.folder().getFolder(fid);
if (folder == null)
return null;
@ -481,6 +481,12 @@ public class FragmentRules extends FragmentBase {
if (type == TYPE_MOVE && target == junk.id)
db.rule().deleteRule(rule.id);
}
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
return null;
}

Loading…
Cancel
Save