-
-
Notifications
You must be signed in to change notification settings - Fork 128
/
cftools.cpp
48 lines (43 loc) · 889 Bytes
/
cftools.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "cftools.hpp"
#include <QDebug>
namespace Network
{
CFTools::CFTools(int index) : Core::Base::Files(index)
{
}
void CFTools::killProcess()
{
}
void CFTools::submit(QString url, QString language)
{
QString filePath;
if (language == "Cpp")
{
filePath = getProgramFile();
}
else if (language == "Java")
{
filePath = getProgramFile(".java");
}
else if (language == "Python")
{
filePath = getProgramFile(".py");
}
else
{
return;
}
// Todo : Invoke cf-tools here.
}
bool CFTools::check()
{
QProcess program;
QString commandToStart = "cf";
QStringList environment = program.systemEnvironment();
program.start(commandToStart);
bool started = program.waitForStarted();
if (started) // 10 Second timeout
program.kill();
return started;
}
} // namespace Network