A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/AlmasB/FXGL/commit/2cb4736da below:

fixed a bug that would cause FS access via gluon attach on embedded d… · AlmasB/FXGL@2cb4736 · GitHub

File tree Expand file treeCollapse file tree 4 files changed

+12

-6

lines changed

Filter options

Expand file treeCollapse file tree 4 files changed

+12

-6

lines changed Original file line number Diff line number Diff line change

@@ -21,6 +21,9 @@ enum class Platform {

21 21

val isDesktop: Boolean

22 22

get() = this === WINDOWS || this === MAC || this === LINUX

23 23 24 +

val isEmbedded: Boolean

25 +

get() = this === EMBEDDED

26 + 24 27

companion object {

25 28

@JvmStatic fun get(): Platform {

26 29

// check if running on mobile first

Original file line number Diff line number Diff line change

@@ -26,16 +26,16 @@ class FileSystemService : EngineService() {

26 26 27 27

private val log = Logger.get(javaClass)

28 28 29 -

@Inject("isDesktop")

30 -

private var isDesktop = true

29 +

@Inject("isMobile")

30 +

private var isMobile = false

31 31 32 32

@Inject("isFileSystemWriteAllowed")

33 33

private var isFileSystemWriteAllowed = true

34 34 35 35

private lateinit var fs: FileSystemAccess

36 36 37 37

override fun onInit() {

38 -

val rootStorage = if (isDesktop)

38 +

val rootStorage = if (!isMobile)

39 39

File(System.getProperty("user.dir") + "/")

40 40

else

41 41

StorageService.create()

Original file line number Diff line number Diff line change

@@ -49,7 +49,7 @@ class FileSystemServiceTest {

49 49 50 50

fs = FileSystemService()

51 51

val injectMap = mapOf(

52 -

"isDesktop" to true,

52 +

"isMobile" to false,

53 53

"isFileSystemWriteAllowed" to true)

54 54 55 55

InjectInTest.inject(MethodHandles.lookup(), fs, injectMap)

@@ -237,7 +237,7 @@ class FileSystemServiceTest {

237 237

fun `Fail on mobile if no private storage present`() {

238 238

val f = FileSystemService()

239 239

val injectMap = mapOf(

240 -

"isDesktop" to false,

240 +

"isMobile" to true,

241 241

"isFileSystemWriteAllowed" to true)

242 242 243 243

InjectInTest.inject(MethodHandles.lookup(), f, injectMap)

@@ -251,7 +251,7 @@ class FileSystemServiceTest {

251 251

fun `FS is not changed if FS write is not allowed`() {

252 252

val f = FileSystemService()

253 253

val injectMap = mapOf(

254 -

"isDesktop" to true,

254 +

"isMobile" to false,

255 255

"isFileSystemWriteAllowed" to false)

256 256 257 257

InjectInTest.inject(MethodHandles.lookup(), f, injectMap)

Original file line number Diff line number Diff line change

@@ -653,6 +653,9 @@ class ReadOnlyGameSettings internal constructor(

653 653

val isMobile: Boolean

654 654

get() = platform.isMobile

655 655 656 +

val isEmbedded: Boolean

657 +

get() = platform.isEmbedded

658 + 656 659

val isBrowser: Boolean

657 660

get() = platform.isBrowser

658 661

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4