Skip to content

Commit

Permalink
windows debug
Browse files Browse the repository at this point in the history
  • Loading branch information
frida-161 committed May 17, 2023
1 parent 2116d0b commit 40617a1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qgis_starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from PyQt5.QtCore import Qt
from pathlib import Path
import subprocess
import sys
import os


Expand Down Expand Up @@ -33,22 +34,23 @@ def start_qgis():
else:
font_name = "Ubuntu"

app = QApplication()
app = QApplication(sys.argv)
app.setFont(QFont(font_name, 15))

if os.name == "nt":
profile_path = (
Path.home() / Path("AppData/Roaming/QGIS/QGIS3/profiles")
)
qgis_dirs = [
path for path in Path("c:/Program Files").iterdir()
qgis_dirs = {
path.name: path
for path in Path("c:/Program Files").iterdir()
if path.is_dir()
and path.stem.startswith("QGIS")
]
}
if len(qgis_dirs) > 1:
qgis_dir = choose_qgis(qgis_dirs)
qgis_dir = qgis_dirs[choose_qgis(qgis_dirs.keys())]
elif len(qgis_dirs) == 1:
qgis_dir = qgis_dirs[0]
qgis_dir = qgis_dirs[qgis_dirs.keys()[0]]
else:
QMessageBox.critical(None, "Error", "QGIS not found")
return
Expand Down

0 comments on commit 40617a1

Please sign in to comment.