MCPcopy Create free account
hub / github.com/aarnt/octopi / executeCommandWithSharedMemHelper

Method executeCommandWithSharedMemHelper

src/unixcommand.cpp:1055–1079  ·  view source on GitHub ↗

* Executes the given command using QProcess async technology with ROOT credentials */

Source from the content-addressed store, hash-verified

1053 * Executes the given command using QProcess async technology with ROOT credentials
1054 */
1055void UnixCommand::executeCommandWithSharedMemHelper(const QString &pCommand, QSharedMemory *sharedMem)
1056{
1057 //Checks if octopi-helper is running. If so, we exit!
1058 if (isOctopiHelperRunning()) return;
1059
1060 //COLUMNS variable code!
1061 QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
1062 env.remove(QStringLiteral("COLUMNS"));
1063 env.insert(QStringLiteral("COLUMNS"), QStringLiteral("132"));
1064 m_process->setProcessEnvironment(env);
1065
1066 /*if (!sharedMem->attach(QSharedMemory::ReadWrite))
1067 {
1068 qDebug() << "\nDetaching and creating new SharedMem...\n";
1069 sharedMem->detach();
1070 UnixCommand::removeSharedMemFiles();
1071 }*/
1072
1073 buildOctopiHelperCommandWithSharedMem(pCommand, sharedMem);
1074
1075 QStringList sl;
1076 sl << ctn_QTSUDO_PARAMS;
1077 sl << ctn_OCTOPI_HELPER_PATH << QStringLiteral("-ts");
1078 m_process->start(WMHelper::getSUCommand(), sl);
1079}
1080
1081/*
1082 * Executes the given command using QProcess async technology as a normal user

Callers 6

cleanCacheMethod · 0.80
doChangeInstallReasonMethod · 0.80
doInstallMethod · 0.80
doRemoveMethod · 0.80
doRemoveAndInstallMethod · 0.80
doSystemUpgradeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected