* Configures the process for accessing the Windows Location API via powershell. */
| 120 | * Configures the process for accessing the Windows Location API via powershell. |
| 121 | */ |
| 122 | QGeoPositionInfoSource::Error defaultSetup(QProcess& process, QByteArray& start_script, QByteArray& stop_script) |
| 123 | { |
| 124 | start_script = startScript(); |
| 125 | if (start_script.isEmpty()) |
| 126 | return QGeoPositionInfoSource::UnknownSourceError; |
| 127 | |
| 128 | stop_script = QByteArrayLiteral("Exit 0 \r\n"); |
| 129 | |
| 130 | auto const powershell_path = QStandardPaths::findExecutable(QStringLiteral("powershell.exe")); |
| 131 | if (powershell_path.isEmpty()) |
| 132 | return QGeoPositionInfoSource::UnknownSourceError; |
| 133 | |
| 134 | process.setProgram(powershell_path); |
| 135 | process.setArguments(QStringLiteral("-NoLogo -NoProfile -NonInteractive -Command -").split(QChar::Space)); |
| 136 | return QGeoPositionInfoSource::NoError; |
| 137 | } |
| 138 | |
| 139 | |
| 140 | } // namespace |
nothing calls this directly
no test coverage detected