-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
79 lines (61 loc) · 1.75 KB
/
main.cpp
File metadata and controls
79 lines (61 loc) · 1.75 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <QApplication>
#include "mainwindow.h"
#include "main.h"
const char *Global::getType(char t)
{
switch (t)
{
case 'v': return "Void";
case 'b': return "Boolean";
case 'i': return "Integer";
case 'd': return "Double";
case 'c': return "Character";
case 's': return "String";
case 'X': return "Buffer";
case 'B': return "Boolean Array";
case 'I': return "Integer Array";
case 'D': return "Double Array";
default: return "Unknown Type";
}
}
model_t *Global::open(const QString &filepath)
{
return model_new();
}
namespace Private
{
namespace Save
{
void * a_scripts(void * udata, const model_t * model, const model_script_t * script);
};};
void * Private::Save::a_scripts(void * udata, const model_t * model, const model_script_t * script)
{
return NULL;
}
bool Global::save(model_t *model, const QString &filepath)
{
QFile file(filepath);
if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate))
{
QMessageBox::warning(NULL, "Error saving file", "Unexpected error saving project file");
return false;
}
file.write("Test");
model_analysis_t funcs;
funcs.scripts = Private::Save::a_scripts;
model_analyse(model, traversal_scripts_modules_configs_linkables_links, &funcs);
file.close();
return true;
}
int main(int argc, char **argv)
{
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);
app.setOrganizationName("MaxKernel");
app.setApplicationName("Kernel Builder");
MainWindow win;
win.show();
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
app.exec();
return 0;
}