Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c5bb19b authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Minor fixes

parent 310e5a17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ class DavService: android.app.Service() {
        val homeSetDao = db.homeSetDao()
        val collectionDao = db.collectionDao()

        val service = db.serviceDao().getById(serviceId) ?: throw IllegalArgumentException("Service not found")
        val service = db.serviceDao().get(serviceId) ?: throw IllegalArgumentException("Service not found")
        val account = Account(service.accountName, getString(R.string.account_type))

        val homeSets = homeSetDao.getByService(serviceId)
+0 −3
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ interface CollectionDao {
    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync ORDER BY displayName, url")
    fun getByServiceAndSync(serviceId: Long): List<Collection>

    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type ORDER BY displayName, url")
    fun observeByServiceAndType(serviceId: Long, type: String): LiveData<List<Collection>>

    @Query("SELECT COUNT(*) FROM collection WHERE serviceId=:serviceId AND sync")
    fun observeHasSyncByService(serviceId: Long): LiveData<Boolean>

+0 −3
Original line number Diff line number Diff line
@@ -9,9 +9,6 @@ interface HomeSetDao {
    @Query("SELECT * FROM homeset WHERE serviceId=:serviceId")
    fun getByService(serviceId: Long): List<HomeSet>

    @Query("SELECT COUNT(*) FROM homeset WHERE serviceId=:serviceId")
    fun observeAvailableByService(serviceId: Long): LiveData<Boolean>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertOrReplace(homeSet: HomeSet): Long

+1 −7
Original line number Diff line number Diff line
@@ -9,12 +9,6 @@ import androidx.room.Query
@Dao
interface ServiceDao {

    @Query("SELECT * FROM service WHERE accountName=:accountName")
    fun getByAccount(accountName: String): List<Service>

    @Query("SELECT * FROM service WHERE accountName=:accountName")
    fun observeByAccount(accountName: String): LiveData<List<Service>>

    @Query("SELECT * FROM service WHERE accountName=:accountName AND type=:type")
    fun getByAccountAndType(accountName: String, type: String): Service?

@@ -22,7 +16,7 @@ interface ServiceDao {
    fun getIdByAccountAndType(accountName: String, type: String): Long?

    @Query("SELECT * FROM service WHERE id=:id")
    fun getById(id: Long): Service?
    fun get(id: Long): Service?

    @Query("SELECT * FROM service WHERE type=:type")
    fun getByType(type: String): List<Service>
+2 −1
Original line number Diff line number Diff line
@@ -151,9 +151,10 @@ class CreateCalendarActivity: AppCompatActivity(), ColorPickerDialogListener {
        }

        if (ok) {
            val frag = CreateCollectionFragment()
            args.putParcelable(CreateCollectionFragment.ARG_ACCOUNT, model.account)
            args.putString(CreateCollectionFragment.ARG_TYPE, Collection.TYPE_CALENDAR)
            val frag = CreateCollectionFragment()
            frag.arguments = args
            frag.show(supportFragmentManager, null)
        }
    }
Loading