Loading src/com/fsck/k9/activity/Accounts.java +1 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import com.fsck.k9.Preferences; import com.fsck.k9.R; import com.fsck.k9.activity.misc.ExtendedAsyncTask; import com.fsck.k9.activity.misc.NonConfigurationInstance; import com.fsck.k9.activity.setup.AccountSettings; import com.fsck.k9.activity.setup.AccountSetupBasics; import com.fsck.k9.activity.setup.Prefs; import com.fsck.k9.activity.setup.WelcomeMessage; Loading Loading @@ -1788,7 +1787,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { LocalSearch search = null; if (account instanceof SearchAccount) { search = ((SearchAccount) account).getRelatedSearch(); search = ((SearchAccount) account).getRelatedSearch().clone(); search.setName(description); } else { search = new LocalSearch(description); Loading src/com/fsck/k9/search/ConditionsTreeNode.java +29 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,35 @@ public class ConditionsTreeNode implements Parcelable { } /* package */ ConditionsTreeNode cloneTree() { if (mParent != null) { throw new IllegalStateException("Can't call cloneTree() for a non-root node"); } ConditionsTreeNode copy = new ConditionsTreeNode(mCondition.clone()); copy.mLeftMPTTMarker = mLeftMPTTMarker; copy.mRightMPTTMarker = mRightMPTTMarker; copy.mLeft = (mLeft == null) ? null : mLeft.cloneNode(copy); copy.mRight = (mRight == null) ? null : mRight.cloneNode(copy); return copy; } private ConditionsTreeNode cloneNode(ConditionsTreeNode parent) { ConditionsTreeNode copy = new ConditionsTreeNode(parent, mValue); copy.mCondition = mCondition.clone(); copy.mLeftMPTTMarker = mLeftMPTTMarker; copy.mRightMPTTMarker = mRightMPTTMarker; copy.mLeft = (mLeft == null) ? null : mLeft.cloneNode(copy); copy.mRight = (mRight == null) ? null : mRight.cloneNode(copy); return copy; } /////////////////////////////////////////////////////////////// // Public modifiers /////////////////////////////////////////////////////////////// Loading src/com/fsck/k9/search/LocalSearch.java +9 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,15 @@ public class LocalSearch implements SearchSpecification { } } @Override public LocalSearch clone() { ConditionsTreeNode conditions = (mConditions == null) ? null : mConditions.cloneTree(); LocalSearch copy = new LocalSearch(mName, conditions, null, mPredefined); copy.mAccountUuids = new HashSet<String>(mAccountUuids); return copy; } /////////////////////////////////////////////////////////////// // Public manipulation methods Loading src/com/fsck/k9/search/SearchSpecification.java +5 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ public interface SearchSpecification extends Parcelable { this.field = Searchfield.values()[in.readInt()]; } @Override public SearchCondition clone() { return new SearchCondition(field, attribute, value); } public String toHumanString() { return field.toString() + attribute.toString(); } Loading Loading
src/com/fsck/k9/activity/Accounts.java +1 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import com.fsck.k9.Preferences; import com.fsck.k9.R; import com.fsck.k9.activity.misc.ExtendedAsyncTask; import com.fsck.k9.activity.misc.NonConfigurationInstance; import com.fsck.k9.activity.setup.AccountSettings; import com.fsck.k9.activity.setup.AccountSetupBasics; import com.fsck.k9.activity.setup.Prefs; import com.fsck.k9.activity.setup.WelcomeMessage; Loading Loading @@ -1788,7 +1787,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { LocalSearch search = null; if (account instanceof SearchAccount) { search = ((SearchAccount) account).getRelatedSearch(); search = ((SearchAccount) account).getRelatedSearch().clone(); search.setName(description); } else { search = new LocalSearch(description); Loading
src/com/fsck/k9/search/ConditionsTreeNode.java +29 −0 Original line number Diff line number Diff line Loading @@ -124,6 +124,35 @@ public class ConditionsTreeNode implements Parcelable { } /* package */ ConditionsTreeNode cloneTree() { if (mParent != null) { throw new IllegalStateException("Can't call cloneTree() for a non-root node"); } ConditionsTreeNode copy = new ConditionsTreeNode(mCondition.clone()); copy.mLeftMPTTMarker = mLeftMPTTMarker; copy.mRightMPTTMarker = mRightMPTTMarker; copy.mLeft = (mLeft == null) ? null : mLeft.cloneNode(copy); copy.mRight = (mRight == null) ? null : mRight.cloneNode(copy); return copy; } private ConditionsTreeNode cloneNode(ConditionsTreeNode parent) { ConditionsTreeNode copy = new ConditionsTreeNode(parent, mValue); copy.mCondition = mCondition.clone(); copy.mLeftMPTTMarker = mLeftMPTTMarker; copy.mRightMPTTMarker = mRightMPTTMarker; copy.mLeft = (mLeft == null) ? null : mLeft.cloneNode(copy); copy.mRight = (mRight == null) ? null : mRight.cloneNode(copy); return copy; } /////////////////////////////////////////////////////////////// // Public modifiers /////////////////////////////////////////////////////////////// Loading
src/com/fsck/k9/search/LocalSearch.java +9 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,15 @@ public class LocalSearch implements SearchSpecification { } } @Override public LocalSearch clone() { ConditionsTreeNode conditions = (mConditions == null) ? null : mConditions.cloneTree(); LocalSearch copy = new LocalSearch(mName, conditions, null, mPredefined); copy.mAccountUuids = new HashSet<String>(mAccountUuids); return copy; } /////////////////////////////////////////////////////////////// // Public manipulation methods Loading
src/com/fsck/k9/search/SearchSpecification.java +5 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,11 @@ public interface SearchSpecification extends Parcelable { this.field = Searchfield.values()[in.readInt()]; } @Override public SearchCondition clone() { return new SearchCondition(field, attribute, value); } public String toHumanString() { return field.toString() + attribute.toString(); } Loading