add Pony() call <3

helper and library refatoring
This commit is contained in:
arcan1s
2014-08-11 21:51:50 +04:00
parent d166668feb
commit 61d814d9a2
14 changed files with 95 additions and 36 deletions

View File

@ -93,9 +93,11 @@ bool Netctl::cmdCall(const bool sudo, const QString command, const QString comma
}
QString cmd = QString("");
if (sudo) cmd = sudoCommand + QString(" ");
if (sudo)
cmd = sudoCommand + QString(" ");
cmd += command + QString(" ") + commandLine;
if (argument != 0) cmd += QString(" ") + argument;
if (argument != 0)
cmd += QString(" ") + argument;
if (debug) qDebug() << "[Netctl]" << "[cmdCall]" << ":" << "Run cmd" << cmd;
TaskResult process = runTask(cmd, (useSuid && sudo));
if (debug) qDebug() << "[Netctl]" << "[cmdCall]" << ":" << "Cmd returns" << process.exitCode;
@ -122,9 +124,11 @@ QString Netctl::getCmdOutput(const bool sudo, const QString command, const QStri
}
QString cmd = QString("");
if (sudo) cmd = sudoCommand + QString(" ");
if (sudo)
cmd = sudoCommand + QString(" ");
cmd += command + QString(" ") + commandLine;
if (argument != 0) cmd += QString(" ") + argument;
if (argument != 0)
cmd += QString(" ") + argument;
if (debug) qDebug() << "[Netctl]" << "[getCmdOutput]" << ":" << "Run cmd" << cmd;
TaskResult process = runTask(cmd, (useSuid && sudo));
if (debug) qDebug() << "[Netctl]" << "[getCmdOutput]" << ":" << "Cmd returns" << process.exitCode;
@ -255,9 +259,9 @@ QString Netctl::getProfileStatus(const QString profile)
else
status = QString("inactive");
if (isProfileEnabled(profile))
status = status + QString(" (enabled)");
status += QString(" (enabled)");
else
status = status + QString(" (static)");
status += QString(" (static)");
return status;
}

View File

@ -100,8 +100,7 @@ QString NetctlProfile::createProfile(const QString profile, const QMap<QString,
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]";
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]" << ":" << "Profile" << profile;
QString profileTempName = QDir::homePath() + QDir::separator() +
QString(".cache") + QDir::separator() + QFileInfo(profile).fileName();
QString profileTempName = QDir::homePath() + QString("/.cache/") + QFileInfo(profile).fileName();
QFile profileFile(profileTempName);
if (debug) qDebug() << "[NetctlProfile]" << "[createProfile]" << ":" << "Save to" << profileTempName;
if (!profileFile.open(QIODevice::WriteOnly | QIODevice::Text))