mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
MacOS: try to remove hard coded python PATH
This commit is contained in:
@@ -48,6 +48,13 @@ int main(int argc, char **argv)
|
|||||||
MacOSXOpenEvent open_event;
|
MacOSXOpenEvent open_event;
|
||||||
app.installEventFilter(&open_event);
|
app.installEventFilter(&open_event);
|
||||||
app.setStyle(QStyleFactory::create("Fusion"));
|
app.setStyle(QStyleFactory::create("Fusion"));
|
||||||
|
|
||||||
|
// Since Apple made difficult for users to set PATH, we set here for convenience.
|
||||||
|
// Users are supposed to install Homebrew Python for Python qet_tb_generator plugin.
|
||||||
|
|
||||||
|
QByteArray path = "/usr/local/bin:";
|
||||||
|
path += qgetenv("PATH");
|
||||||
|
qputenv("PATH", path.constData());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (app.isSecondary())
|
if (app.isSecondary())
|
||||||
|
|||||||
@@ -2262,10 +2262,10 @@ void QETDiagramEditor::generateTerminalBlock()
|
|||||||
|
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
if (openedProjects().count()){
|
if (openedProjects().count()){
|
||||||
success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.8/bin/qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.8/bin/qet_tb_generator");
|
success = process->startDetached("qet_tb_generator");
|
||||||
}
|
}
|
||||||
if (openedProjects().count()){
|
if (openedProjects().count()){
|
||||||
success = process->startDetached(QDir::homePath() + "/.qet/qet_tb_generator.app", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
success = process->startDetached(QDir::homePath() + "/.qet/qet_tb_generator.app", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
|
|||||||
Reference in New Issue
Block a user