MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / getCmdPath

Function getCmdPath

src/spawn.cpp:840–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840QFileInfo getCmdPath()
841{
842 const auto p = env::get("COMSPEC");
843 if (!p.isEmpty()) {
844 return QFileInfo(p);
845 }
846
847 QString systemDirectory;
848
849 const std::size_t buffer_size = 1000;
850 wchar_t buffer[buffer_size + 1] = {};
851
852 const auto length = ::GetSystemDirectoryW(buffer, buffer_size);
853 if (length != 0) {
854 systemDirectory = QString::fromWCharArray(buffer, length);
855
856 if (!systemDirectory.endsWith("\\")) {
857 systemDirectory += "\\";
858 }
859 } else {
860 systemDirectory = "C:\\Windows\\System32\\";
861 }
862
863 return QFileInfo(systemDirectory + "cmd.exe");
864}
865
866FileExecutionTypes getFileExecutionType(const QFileInfo& target)
867{

Callers 1

getFileExecutionContextFunction · 0.85

Calls 2

getFunction · 0.70
isEmptyMethod · 0.45

Tested by

no test coverage detected