forked from NinjaCheetah/NUSGet
Add safeguards to system Qt library loading on Linux
Also made minor update for libWiiPy v0.6.0 compatibility
This commit is contained in:
parent
35989d038a
commit
449a680d32
20
NUSGet.py
20
NUSGet.py
@ -502,11 +502,21 @@ if __name__ == "__main__":
|
|||||||
# it looks nice, but fallback on kvantum if it isn't, since kvantum is likely to exist. If all else fails, fusion.
|
# it looks nice, but fallback on kvantum if it isn't, since kvantum is likely to exist. If all else fails, fusion.
|
||||||
if platform.system() == "Linux":
|
if platform.system() == "Linux":
|
||||||
if os.path.isdir("/usr/lib/qt6/plugins"):
|
if os.path.isdir("/usr/lib/qt6/plugins"):
|
||||||
app.addLibraryPath("/usr/lib/qt6/plugins")
|
import subprocess
|
||||||
if "Breeze" in QStyleFactory.keys():
|
try:
|
||||||
app.setStyle("Breeze")
|
# This CANNOT be the best way to get the system Qt version, but it's what I came up with for now.
|
||||||
elif "kvantum" in QStyleFactory.keys():
|
result = subprocess.run(['/usr/lib/qt6/bin/qtdiag'], stdout=subprocess.PIPE)
|
||||||
app.setStyle("kvantum")
|
result_str = result.stdout.decode("utf-8").split("\n")[0]
|
||||||
|
sys_qt_ver = result_str.split(" ")[1].split(".")
|
||||||
|
pyside_qt_ver = version("PySide6").split(".")
|
||||||
|
if sys_qt_ver[0:2] == pyside_qt_ver[0:2]:
|
||||||
|
app.addLibraryPath("/usr/lib/qt6/plugins")
|
||||||
|
if "Breeze" in QStyleFactory.keys():
|
||||||
|
app.setStyle("Breeze")
|
||||||
|
elif "kvantum" in QStyleFactory.keys():
|
||||||
|
app.setStyle("kvantum")
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
||||||
# Load qtbase translations, and then apps-specific translations.
|
# Load qtbase translations, and then apps-specific translations.
|
||||||
path = QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)
|
path = QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user