summaryrefslogtreecommitdiff
path: root/src/common/common.cpp
blob: 56ecaaa7701c86bd388e48f971cea389f9abe2ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: GPL-2.0-or-later

#include <stdlib.h>

#include <QString>
#include <QProcess>
#include <QStringList>
#include "common.h"

namespace FQTerm {

void runProgram(const QString &cmd, const QString& arg, bool bg) {
  if (bg) {
    QProcess::startDetached(cmd, QStringList(arg));
  } else {
    QProcess::execute(cmd, QStringList(arg));
  }
  
  return;
  /*
#if defined(WIN32)
  QString strCmd = "\"\"" + cmd + "\" \"" + arg + "\"\"";
#else
  QString strCmd = "'" + cmd + "' '" + arg + "'";
#endif
#if !defined(WIN32)
  if (bg) {
    strCmd += " &";
  }
#endif
  system(strCmd.toLocal8Bit());
  */
}

}  // namespace FQTerm