Milan Jurkulak 1 gadu atpakaļ
vecāks
revīzija
8cad966150

+ 6 - 2
composeApp/src/androidMain/AndroidManifest.xml

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools">
+    xmlns:tools="http://schemas.android.com/tools"
+    tools:ignore="SelectedPhotoAccess">
 
     <uses-feature
         android:name="android.software.leanback"
@@ -13,7 +14,10 @@
     <uses-permission
         android:name="android.permission.QUERY_ALL_PACKAGES"
         tools:ignore="QueryAllPackagesPermission" />
-    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
+        tools:ignore="ScopedStorage" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
+        tools:ignore="ScopedStorage" />
     <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
     <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
     <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />

+ 13 - 0
composeApp/src/androidMain/kotlin/org/mjdev/desktop/data/UserDirs.kt

@@ -1,6 +1,7 @@
 package org.mjdev.desktop.data
 
 import okio.Path
+import org.mjdev.desktop.extensions.PathExt.mkdirs
 import org.mjdev.desktop.interfaces.IUserDirs
 
 @Suppress("unused")
@@ -12,6 +13,18 @@ class UserDirs(
         name: String
     ): Path = homeDirectory.resolve(name)
 
+    init {
+        runCatching { desktopDirectory.mkdirs() }
+        runCatching { downloadDirectory.mkdirs() }
+        runCatching { templatesDirectory.mkdirs() }
+        runCatching { publicShareDirectory.mkdirs() }
+        runCatching { documentsDirectory.mkdirs() }
+        runCatching { musicDirectory.mkdirs() }
+        runCatching { picturesDirectory.mkdirs() }
+        runCatching { videosDirectory.mkdirs() }
+        runCatching { backgroundsDirectory.mkdirs() }
+    }
+
     override val desktopDirectory: Path
         get() = this[IUserDirs.DESKTOP_DIR]
     override val downloadDirectory: Path

+ 5 - 5
composeApp/src/commonMain/kotlin/org/mjdev/desktop/helpers/generic/Queue.kt

@@ -27,7 +27,7 @@ class Queue<E>(
             }
         }
 
-//        source.isEmpty() -> throw (IllegalStateException("Source is empty."))
+        source.isEmpty() -> throw (IllegalStateException("Source is empty."))
 
         else -> {
             currentIndex = 0
@@ -45,10 +45,10 @@ class Queue<E>(
                 }
             }
 
-//            source.isEmpty() -> {
-//                Log.e("No background, empty list.")
-//                null
-//            }
+            source.isEmpty() -> {
+                Log.e("No background, empty list.")
+                null
+            }
 
             else -> {
                 currentIndex = 0