File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -462,10 +462,13 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
462
462
QStringList preferred_list = {" pinentry-gnome3" ,
463
463
" pinentry-qt"
464
464
" pinentry-gtk2" };
465
+ QStringList search_paths = {" /bin" , " /usr/bin" , " /usr/local/bin" }
465
466
#elif defined(__APPLE__) && defined(__MACH__)
466
467
QStringList preferred_list = {" pinentry-mac" , " pinentry-qt" };
468
+ QStringList search_paths = {" /opt/homebrew/bin" , " /usr/local/bin" };
467
469
#else
468
470
QStringList preferred_list = {" pinentry-qt" };
471
+ QStringList search_paths = {};
469
472
#endif
470
473
471
474
if (IsFlatpakENV ()) {
@@ -480,6 +483,15 @@ auto GPGFRONTEND_CORE_EXPORT DecidePinentry() -> QString {
480
483
}
481
484
}
482
485
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
+
483
495
return {};
484
496
}
485
497
} // namespace GpgFrontend
You can’t perform that action at this time.
0 commit comments