本文整理汇总了C++中QProcess::workingDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ QProcess::workingDirectory方法的具体用法?C++ QProcess::workingDirectory怎么用?C++ QProcess::workingDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QProcess
的用法示例。
在下文中一共展示了QProcess::workingDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: workingDirectory
QString QProcessProto::workingDirectory() const
{
QProcess *item = qscriptvalue_cast<QProcess*>(thisObject());
if (item)
return item->workingDirectory();
return QString();
}
示例2: runBuildProcess
// Run a build process with merged stdout/stderr and qWarn about errors.
static bool runBuildProcess(QProcess &proc,
const FileName &binary,
const QStringList &args,
int timeoutS,
bool ignoreNonNullExitCode,
QString *output, QString *errorMessage)
{
const bool rc = runBuildProcessI(proc, binary, args, timeoutS, ignoreNonNullExitCode, output, errorMessage);
if (!rc) {
// Fail - reformat error.
QString cmd = binary.toString();
if (!args.isEmpty()) {
cmd += QLatin1Char(' ');
cmd += args.join(QLatin1Char(' '));
}
*errorMessage =
QCoreApplication::translate("ProjectExplorer::BuildableHelperLibrary",
"Error running \"%1\" in %2: %3").
arg(cmd, proc.workingDirectory(), *errorMessage);
qWarning("%s", qPrintable(*errorMessage));
}
return rc;
}
示例3: ssl_servername_cb
// int VSslServer::ssl_servername_cb_debug(SSL *con, int *ad, void *arg, int* debug) // gilgil temp 2014.03.14
int VSslServer::ssl_servername_cb(SSL *con, int *ad, void *arg)
{
Q_UNUSED(ad)
const char* serverName = SSL_get_servername(con, TLSEXT_NAMETYPE_host_name);
// *debug = 1000; // gilgil temp 2014.03.14
if (serverName == NULL)
{
LOG_DEBUG("serverName is null");
return SSL_TLSEXT_ERR_NOACK;
}
// *debug = 2500; // gilgil temp 2014.03.14
// LOG_DEBUG("serverName=%p %s", serverName, serverName); // gilgil temp 2014.03.14
// *debug = 3000; // gilgil temp 2014.03.14
VSslServer* server = (VSslServer*)(arg);
LOG_ASSERT(server != NULL);
VSslServerSession* session = (VSslServerSession*)SSL_get_ex_data(con, VSslSession::VSSL_SESSION_IDENTIFY_INDEX);
LOG_ASSERT(session->con == con);
// *debug = 500; // gilgil temp 2014.03.14
// LOG_DEBUG("server=%p session=%p", server, session); // gilgil temp 2014.03.14
QString path = server->certificatePath;
QFileInfo fi(path);
if (!fi.isAbsolute())
{
// path = VApp::_filePath() + path; // gilgil temp 2014.12.25
path = QCoreApplication::applicationDirPath() + QDir::separator() + path;
}
if (!path.endsWith('/') && !path.endsWith('\\')) path += QDir::separator();
QString fileName = path + serverName + ".pem";
// *debug = 4000; // gilgil temp 2014.03.14
{
VLock lock(server->certificateCs); // protect file create critical section
// *debug = 5000; // gilgil temp 2014.03.14
if (!QFile::exists(fileName))
{
QProcess process;
process.setWorkingDirectory(path);
LOG_DEBUG("working directory=%s", qPrintable(process.workingDirectory())); // gilgil temp 2014.03.01
QString command = QString("\"%1_make_site.bat\" %2 2>&1").arg(path).arg(serverName);
LOG_INFO("command=%s", qPrintable(command));
process.start(command);
// LOG_DEBUG("pid=%llx", process.pid()); // gilgil temp 2015.01.02
// *debug = 6000; // gilgil temp 2014.03.14
if(!process.waitForStarted())
{
LOG_FATAL("process.waitForStarted(%s) return false", qPrintable(command));
}
// *debug = 700; // gilgil temp 2014.03.14
while(process.waitForReadyRead())
{
QByteArray ba = process.readAll();
LOG_DEBUG("ba.size=%d", ba.size())
LOG_DEBUG("ba.datas=%s", ba.data());
}
// *debug = 8000; // gilgil temp 2014.03.14
}
// *debug = 9000; // gilgil temp 2014.03.14
// LOG_DEBUG("con=%p", con); // gilgil temp 2014.03.14
// *debug = 9100; // gilgil temp 2014.03.14
if (!session->setup(fileName))
{
LOG_ERROR("session->setup(%s) return false", qPrintable(fileName));
}
// *debug = 9500; // gilgil temp 2014.03.14
}
return SSL_TLSEXT_ERR_NOACK;
}