Welcome to mirror list, hosted at ThFree Co, Russian Federation.

main.cpp « src « hakchi-gui - github.com/ClusterM/hakchi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d41a1318b7ac3b70c9331eeb0e7d1000222de06d (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
#include "mainwindow.h"
#include <QApplication>
#include <QDir>
#include <stdlib.h>

int main(int argc,char*argv[])
{
    QDir dir(".");
    for(int i=0;i<4;i++)
    {
        if(dir.exists("bin"))
            break;
        else
            dir.cdUp();
    }
    if(dir.exists("bin"))
        dir.setCurrent(dir.absolutePath());
    QString path=QString::fromLocal8Bit(getenv("PATH"));
#ifdef WIN32
    path=QString("PATH=%1\\bin;%2").arg(dir.absolutePath()).arg(path);
    _putenv(path.toLocal8Bit());
#else
    path=QString("%1/bin:%2").arg(dir.absolutePath()).arg(path);
    setenv("PATH",path.toLocal8Bit(),1);
#endif

    QApplication a(argc,argv);
    MainWindow w;
    w.show();
    return a.exec();
}