File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -462,10 +462,13 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
462462 QStringList preferred_list = {" pinentry-gnome3" ,
463463 " pinentry-qt"
464464 " pinentry-gtk2" };
465+ QStringList search_paths = {" /bin" , " /usr/bin" , " /usr/local/bin" }
465466#elif defined(__APPLE__) && defined(__MACH__)
466467 QStringList preferred_list = {" pinentry-mac" , " pinentry-qt" };
468+ QStringList search_paths = {" /opt/homebrew/bin" , " /usr/local/bin" };
467469#else
468470 QStringList preferred_list = {" pinentry-qt" };
471+ QStringList search_paths = {};
469472#endif
470473
471474 if (IsFlatpakENV ()) {
@@ -480,6 +483,15 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
480483 }
481484 }
482485
486+ if (search_paths.isEmpty ()) return {};
487+
488+ for (const QString& name : preferred_list) {
489+ QString path = QStandardPaths::findExecutable (name, search_paths);
490+ if (!path.isEmpty ()) {
491+ return path;
492+ }
493+ }
494+
483495 return {};
484496}
485497} // namespace GpgFrontend
You can’t perform that action at this time.
0 commit comments