Don't use user theme in debug mode

This commit is contained in:
miruka 2019-07-24 18:46:13 -04:00
parent b6290ad3c9
commit a2469bd994
3 changed files with 8 additions and 2 deletions

View File

@ -68,7 +68,6 @@
- Prevent using the SendBox if no permission (power levels) - Prevent using the SendBox if no permission (power levels)
- Spinner when loading past room events, images or clicking buttons - Spinner when loading past room events, images or clicking buttons
- Theming - Theming
- Don't use user theme in debug mode
- Don't create additional lines in theme conversion (braces) - Don't create additional lines in theme conversion (braces)
- Recursively merge default and user theme - Recursively merge default and user theme
- Distribute fonts - Distribute fonts

View File

@ -24,6 +24,7 @@ class App:
from .backend import Backend from .backend import Backend
self.backend = Backend(app=self) self.backend = Backend(app=self)
self.debug = False
from .image_provider import ImageProvider from .image_provider import ImageProvider
self.image_provider = ImageProvider(self) self.image_provider = ImageProvider(self)
@ -35,7 +36,9 @@ class App:
def is_debug_on(self, cli_flags: Sequence[str] = ()) -> bool: def is_debug_on(self, cli_flags: Sequence[str] = ()) -> bool:
return "-d" in cli_flags or "--debug" in cli_flags debug = "-d" in cli_flags or "--debug" in cli_flags
self.debug = debug
return debug
def _loop_starter(self) -> None: def _loop_starter(self) -> None:

View File

@ -151,6 +151,10 @@ class Theme(ConfigFile):
async def read(self) -> str: async def read(self) -> str:
# pylint: disable=no-member
if self.backend.app.debug:
return convert_to_qml(await self.default_data())
if not self.path.exists(): if not self.path.exists():
await self.write(await self.default_data()) await self.write(await self.default_data())