Skip to content

Commit

Permalink
fix(app): set freeze support in backend
Browse files Browse the repository at this point in the history
Signed-off-by: yshalsager <[email protected]>
  • Loading branch information
yshalsager committed Dec 11, 2023
1 parent ef78bb8 commit 74d9cab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/domain/backend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Backend that interacts with tafrigh."""
import json
import multiprocessing
from collections import OrderedDict
from pathlib import Path
from platform import system
Expand Down Expand Up @@ -73,6 +74,9 @@ def on_finish(self) -> None:

@Slot()
def start(self) -> None:
if system() != "Linux":
multiprocessing.freeze_support()

worker = Worker(func=self.run)
worker.signals.finished.connect(self.on_finish)
worker.signals.progress.connect(self.on_progress)
Expand Down
13 changes: 3 additions & 10 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
"""Entry point for the application."""
import sys
from pathlib import Path
from platform import system

# noinspection PyUnresolvedReferences
import resources_rc
from PySide6.QtCore import QUrl, QTimer
from PySide6.QtCore import QTimer, QUrl
from PySide6.QtQml import QQmlApplicationEngine
from PySide6.QtQuickControls2 import QQuickStyle
from PySide6.QtWidgets import QApplication

# noinspection PyUnresolvedReferences
import resources_rc
from domain.backend import Backend
from domain.clipboardproxy import ClipboardProxy

Expand All @@ -24,12 +23,6 @@ def load_main_window() -> None:


if __name__ == "__main__":
if system() == "Windows":
import multiprocessing

multiprocessing.freeze_support()
multiprocessing.set_start_method("spawn")

app = QApplication(sys.argv)
app.setOrganizationName("ieasybooks")
app.setOrganizationDomain("https://almufaragh.com/")
Expand Down

0 comments on commit 74d9cab

Please sign in to comment.