grant folder access permission alert many times at once on MacOS Monterey with M1 CPU
Solved
General and Desktop
-
Qt version: 6.2.3
This situation only happens on M1 CPU Monterey, Intel CPU work fine.
When I usedQDesktopServices::openUrl(QUrl(folderPath, QUrl::TolerantMode));
to open a removable volume folder, OS didn't remember the user already granted before and it will alert many times at once.
So, I tried another solution to fix it, using "Finder" to open it with Applescript.auto f = [volumePath]() { system(QString::asprintf("osascript -e 'tell app \"Finder\" to open POSIX file \"%s\" activate'",volumePath.toLatin1().data()).toUtf8().data()); }; QThread *systemCallThread = QThread::create(f); systemCallThread->start();