MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / defaultSetup

Function defaultSetup

src/sensors/powershell_position_source.cpp:122–137  ·  view source on GitHub ↗

* Configures the process for accessing the Windows Location API via powershell. */

Source from the content-addressed store, hash-verified

120 * Configures the process for accessing the Windows Location API via powershell.
121 */
122QGeoPositionInfoSource::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

Callers

nothing calls this directly

Calls 2

startScriptFunction · 0.85
isEmptyMethod · 0.45

Tested by

no test coverage detected