Back to index

qt_sys_utils.hpp File Reference
#include "string.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


int qt_system (string)
int qt_system (string, string &)

Function Documentation

int qt_system ( string  )

Definition at line 20 of file qt_sys_utils.cpp.

  string result;
  return qt_system (cmd, result);

Here is the call graph for this function:

Here is the caller graph for this function:

int qt_system ( string  ,

Definition at line 26 of file qt_sys_utils.cpp.

  QProcess proc;

  proc.setProcessChannelMode (QProcess::MergedChannels);
  char* _cmd = as_charp (cmd);
#if defined (__MINGW__) || defined (__MINGW32__)
  QString qcmd = QString::fromLocal8Bit (as_charp (_cmd));
  QString qcmd = "sh -c \"";
  qcmd += _cmd;
  qcmd += "\"";
  tm_delete_array (_cmd);
  proc.start (qcmd);
  if (! proc.waitForStarted ()) {
    if (DEBUG_STD) cerr << "TeXmacs] System: failed to launch command\n";
    return 1;
  proc.closeWriteChannel ();
  if (! proc.waitForFinished (-1)) {
    if (DEBUG_STD) cerr << "TeXmacs] System: waiting for too long\n";
    return 1;
  result = proc.readAll ().constData ();
  if (DEBUG_STD) cerr << result;
  return proc.exitCode ();

Here is the call graph for this function: