#include "MessageDialog.h"
#include "vlp/config.h"
+#include "vlp/QtConfigurationFinder.h"
+#include "vlp/exception/ConfigFileNotFound.h"
#include <sys/prctl.h>
/* File resides in top directory (where are Makefiles)*/
{
setupUi(this);
- QString arg0(argv[0]);
- arg0 += "/";
- homeDir = QDir(arg0);
- homeDir.cdUp();
-
-
int i;
for(i = 0; (i < 5) && (i < argc-1); i++) {
strcpy(myargs[i], "");
}
}
+ loglan::vlp::QtConfigurationFinder configFinder;
+ configFinder.initSearchDirs();
+
QDir q(getRemoteDir());
if (!q.exists()) {
ActiveConnections = 0;
strcpy(LockPasswd, "");
- loadConfig(getConfigFilePath());
+ loadConfig(configFinder.findConfig().c_str());
RunNetModule();
}
strncpy(progdir, config.getProgramDir(), 256);
+
+ homeDir = QDir(QCoreApplication::applicationDirPath());
}
}
pid_t pid = fork();
if (pid == 0) {
if (execl(program.toStdString().c_str(),
+ "logedit",
getHomeDir(),
myargs[0],
myargs[1],
pid_t pid = fork();
if (pid == 0) {
if (execl(program.toStdString().c_str(),
+ "loghelp",
docDir.toStdString().c_str(),
myargs[0],
myargs[1],
pid_t pid = fork();
if (pid == 0) {
if (execl(program.toStdString().c_str(),
+ "loggraph",
program.toStdString().c_str(),
sk,
myargs[0],
pid_t pid = fork();
if (pid == 0) {
if (execl(program.toStdString().c_str(),
- program.toStdString().c_str(),
+ "lognet",
getNetModuleSocket(),
getConfigFilePath().toStdString().c_str(),
myargs[0],
strcpy(newINT->shortname, b);
strcpy(newINT->fullname, ss);
- sprintf(a, "%s%d", IPATH, newint);
+ sprintf(a, "%s%d", homeDir.absoluteFilePath(IPATH).toStdString().c_str(), newint);
sprintf(cmd, "%s/modules/logint %s %s",
getHomeDir(),
a,
if (r) {
strcat(cmd, " r");
}
- sprintf(b, " %s %s %s %s %s",
- myargs[0], myargs[1], myargs[2], myargs[3], myargs[4]);
- strcat(cmd, b);
+// sprintf(b, " %s %s %s %s %s",
+// myargs[0], myargs[1], myargs[2], myargs[3], myargs[4]);
+// sprintf(cmd, "%s %s", cmd, b);
+// strcat(cmd, b);
+ fprintf(stderr, "%s\n", cmd);
strcat(cmd, " &");
sock = socket(AF_UNIX, SOCK_STREAM, 0);