6
#include <kstandarddirs.h>
8
int main(int argc, char **argv) {
9
KInstance * instance = new KInstance("%{APPNAMELC}");
10
QString appdir = ::locate("data", "%{APPNAMELC}/main.rb", instance);
12
if (appdir.isNull()) {
13
qFatal("Error: Can't find \"%{APPNAMELC}/main.rb\"\n");
15
QFileInfo program(appdir);
17
char ** rubyargs = (char **) calloc(argc+4, sizeof(char *));
18
rubyargs[0] = strdup(argv[0]);
19
rubyargs[1] = strdup("-KU");
20
rubyargs[2] = strdup(QString("-C%1").arg(program.dirPath()).latin1());
21
rubyargs[3] = strdup(QString("-I%1").arg(program.dirPath()).latin1());
22
rubyargs[4] = strdup(program.fileName().latin1());
23
for (int i = 1; i < argc; i++) {
24
rubyargs[i+4] = argv[i];
28
ruby_options(argc+4, rubyargs);