#include <QApplication>
//#include <QDebug>
#include "updaterdialog.h"

void loadQss()
{
    QFile f(":qdarkstyle/dark/darkstyle.qss");
//    QFile f(":qdarkstyle/light/lightstyle.qss");
    if (!f.exists())
    {
        printf("Unable to set stylesheet, file not found\n");
    }
    else
    {
        f.open(QFile::ReadOnly | QFile::Text);
        QTextStream ts(&f);
        qApp->setStyleSheet(ts.readAll());
    }
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    loadQss();

    if(argc > 1)
    {
        APPNAME = argv[1];
        APPVERSION = argv[2];
        APPDATE = argv[3];
        MODIFYCNT = argv[4];
    }
    else
    {
        APPNAME = "";
        APPVERSION = "0";
    }
    CHECK_URL = ORIGIN_URL + APPNAME + "/updates.json";

    UpdaterDialog w;
    w.show();
    return a.exec();
}
