mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
feat: big ass redesign: Carry the stores' motion and layout into Steam settings, Components, Setup, Flathub and Desktop (#548)
This commit is contained in:
1 parent
e5ba165027
commit
fc026263e4
43 files changed
+4351
-1819
No files matched your search
@@ -110,6 +110,9 @@ object DesktopCatalog {
|
||||
return File(root, DesktopRemoval.PENDING).exists() || marker(context, DESKTOP_ID).exists()
|
||||
}
|
||||
|
||||
/** The installed desktop's size on disk; off the main thread. */
|
||||
fun desktopSize(context: Context): Long = DesktopRemoval.installedSize(context)
|
||||
|
||||
fun cleanLegacy(context: Context, listener: LinuxRuntimeInstaller.ProgressListener? = null) =
|
||||
DesktopRemoval.cleanLegacy(context, listener)
|
||||
|
||||
|
||||
@@ -19,6 +19,14 @@ internal object DesktopRemoval {
|
||||
private fun protected(context: Context, root: File) =
|
||||
DesktopFileRemoval.runtimeFiles(root) + lines(context, "emulators-keep.txt.gzip")
|
||||
|
||||
/**
|
||||
* What the desktop's own files take on disk, from the same inventory its removal uses (each
|
||||
* file's size); the bundled apps' and emulators' shared files are not counted. Reads an asset:
|
||||
* call it off the main thread.
|
||||
*/
|
||||
fun installedSize(context: Context): Long =
|
||||
lines(context, "kde-remove.tsv.gzip").sumOf { line -> line.split('\t').getOrNull(1)?.toLongOrNull() ?: 0L }
|
||||
|
||||
/** Called before a guest starts or just after KDE extraction; retries after a process death. */
|
||||
fun cleanLegacy(context: Context, listener: LinuxRuntimeInstaller.ProgressListener? = null) {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
|
||||
Reference in new issue
Block a user