Fixed ScheduleUpdateSheet.kt not updating and deleting events... somehow. Also implemented cheat codes hehe

This commit is contained in:
denizk0461
2023-04-26 18:36:32 +02:00
parent d80e85fdbe
commit 450ce92dca
10 changed files with 233 additions and 69 deletions
@@ -10,6 +10,44 @@ import com.denizk0461.studip.model.SettingsPreferences
*/
class SettingsViewModel(app: Application) : AppViewModel(app) {
/**
* Deletes everything from the database.
*/
fun nukeEverything() {
nukeEvents()
nukeOfferItems()
nukeOfferCategories()
nukeOfferCanteens()
nukeOfferDates()
}
/**
* Deletes all Stud.IP events from the database.
*/
fun nukeEvents() { doAsync { repo.nukeEvents() } }
/**
* Deletes all canteen items from the database.
*/
fun nukeOfferItems() { doAsync { repo.nukeOfferItems() } }
/**
* Deletes all canteen categories from the database.
*/
fun nukeOfferCategories() { doAsync { repo.nukeOfferCategories() } }
/**
* Deletes all canteens from the database.
*/
fun nukeOfferCanteens() { doAsync { repo.nukeOfferCanteens() } }
/**
* Deletes all canteen dates from the database.
*/
fun nukeOfferDates() { doAsync { repo.nukeOfferDates() } }
/**
* This value determines whether the user wants to have the next course in their schedule
* highlighted.