-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
deprecation(libanki): move to col.defaultsForAdding #19650
Copy link
Copy link
Labels
DeprecationWarnings on deprecated API usageWarnings on deprecated API usageGood First IssuePriority-Low
Milestone
Description
Anki-Android/libanki/src/main/java/com/ichi2/anki/libanki/Notetypes.kt
Lines 147 to 158 in bab0fb4
| /** Get current model.*/ | |
| @RustCleanup("Should use defaultsForAdding() instead") | |
| fun current(forDeck: Boolean = true): NotetypeJson { | |
| var noteType = get(col.decks.current().getLongOrNull("mid")) | |
| if (!forDeck || noteType == null) { | |
| noteType = get(col.config.get("curModel") ?: 1L) | |
| } | |
| if (noteType != null) { | |
| return noteType | |
| } | |
| return get(allNamesAndIds().first().id)!! | |
| } |
Anki-Android/libanki/src/main/java/com/ichi2/anki/libanki/Collection.kt
Lines 691 to 701 in 3b9ad21
| /** | |
| * Get starting deck and notetype for add screen. | |
| * An option in the preferences controls whether this will be based on the current deck | |
| * or current notetype. | |
| */ | |
| @CheckResult | |
| @LibAnkiAlias("defaults_for_adding") | |
| fun defaultsForAdding(currentReviewCard: Card? = null): anki.notes.DeckAndNotetype { | |
| val homeDeck = currentReviewCard?.currentDeckId() ?: 0L | |
| return backend.defaultsForAdding(homeDeckOfCurrentReviewCard = homeDeck) | |
| } |
and deprecate current()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DeprecationWarnings on deprecated API usageWarnings on deprecated API usageGood First IssuePriority-Low