Skip to content

Commit

Permalink
feat(profiles): support qgis run in other profiles path than default
Browse files Browse the repository at this point in the history
- closes Profile Manager does not respect --profiles-path start up option WhereGroup#5
  • Loading branch information
jmkerloch committed Sep 12, 2024
1 parent 45f7861 commit 205c76b
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions profiles/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,12 @@


def qgis_profiles_path() -> Path:
"""Get QGIS profiles paths from current platforms
- Windows : $HOME / "AppData" / "Roaming" / "QGIS" / "QGIS3" / "profiles"
- MacOS : $HOME / "Library" / "Application Support" / "QGIS" / "QGIS3" / "profiles"
- Linux : $HOME / ".local" / "share" / "QGIS" / "QGIS3" / "profiles"
"""Get QGIS profiles paths from current QGIS application
Returns:
Path: QGIS profiles path
"""
home_path = Path.home()
# Windows
if platform.startswith("win32"):
return home_path / "AppData" / "Roaming" / "QGIS" / "QGIS3" / "profiles"
# MacOS
if platform == "darwin":
return (
home_path
/ "Library"
/ "Application Support"
/ "QGIS"
/ "QGIS3"
/ "profiles"
)
# Linux
return home_path / ".local" / "share" / "QGIS" / "QGIS3" / "profiles"
return Path(iface.userProfileManager().rootLocation())


def get_profile_qgis_ini_path(profile_name: str) -> Path:
Expand Down

0 comments on commit 205c76b

Please sign in to comment.