From 67c3ef59067eea7ee755327e86d543f055134504 Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 28 Apr 2019 20:37:11 -0400 Subject: [PATCH] Disable QML cache, responsible of multiple bugs --- TODO.md | 2 +- harmonyqml/__init__.py | 9 +++++++-- harmonyqml/components/Chat/Chat.qml | 2 -- harmonyqml/components/UI.qml | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index 0456d9e1..38975e81 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ - Don't bake in size properties for components - Bug fixes - - The damn remember account dialog - 100% CPU usage when hitting top edge to trigger messages loading - Sending `![A picture](https://picsum.photos/256/256)` → not clickable? - Icons aren't reloaded @@ -25,6 +24,7 @@ - Prevent using the SendBox if no permission (power levels) - Spinner when loading past room events, images or clicking buttons - Better theming/styling system + - See about - Settings page - Multiaccount aliases diff --git a/harmonyqml/__init__.py b/harmonyqml/__init__.py index bd8a6af1..7ea42a73 100644 --- a/harmonyqml/__init__.py +++ b/harmonyqml/__init__.py @@ -1,12 +1,17 @@ # Copyright 2019 miruka # This file is part of harmonyqml, licensed under GPLv3. +import os import sys -from . import app - # logging.basicConfig(level=logging.INFO) +# The disk cache is responsible for multiple display bugs when running +# the app for the first time/when cache needs to be recompiled, on top +# of litering the source folders with .qmlc files. +os.environ["QML_DISABLE_DISK_CACHE"] = "1" + def run() -> None: + from . import app _ = app.Application(sys.argv) diff --git a/harmonyqml/components/Chat/Chat.qml b/harmonyqml/components/Chat/Chat.qml index 6c46c522..919d9a10 100644 --- a/harmonyqml/components/Chat/Chat.qml +++ b/harmonyqml/components/Chat/Chat.qml @@ -12,8 +12,6 @@ HColumnLayout { property bool canLoadPastEvents: true - Component.onCompleted: console.log("replaced") - id: chatPage onFocusChanged: sendBox.setFocus() diff --git a/harmonyqml/components/UI.qml b/harmonyqml/components/UI.qml index 06245f2d..38cd05e7 100644 --- a/harmonyqml/components/UI.qml +++ b/harmonyqml/components/UI.qml @@ -44,8 +44,8 @@ Item { } Component.onCompleted: { - if (initialPageSet) { return } - initialPageSet = true + if (pageStack.initialPageSet) { return } + pageStack.initialPageSet = true showPage(accountsLoggedIn ? "Default" : "SignIn") }