#include "mainwindow.h" #include "net/net.h" #include "settings/settings.h" #include "utils/utils.h" #include #include #include #if __GNUC__ < 8 && __clang_major__ < 17 # include using namespace std::experimental::filesystem; #else # include using namespace std::filesystem; #endif #include #include #include int main(int argc, char *argv[]) { curl_global_init(CURL_GLOBAL_ALL); std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser"); create_directories(program_data_path); std::string settings_file_path = get_path_relative_to_home(".local/share/checks_parser/settings.json"); Settings s(settings_file_path); Net n; Parser p; std::vector stores_updates = p.check_updates(); for (const std::string &update : stores_updates) { std::cout << "Downloading " << s.get_setting("stores_modules_url") + update << " to " << get_path_relative_to_home(s.get_setting("stores_modules_dir") + "/" + update) << std::endl; n.get_file(s.get_setting("stores_modules_url") + "/" + update, get_path_relative_to_home(s.get_setting("stores_modules_dir") + "/" + update)); } QApplication a(argc, argv); QTranslator translator; QString lang = "en_US"; if (s.get_all_settings().contains("language")) { std::cout << "settings" << std::endl; lang = QString::fromStdString(s.get_all_settings()["language"]); } else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) { std::cout << "system" << std::endl; lang = QLocale::system().name(); } else { std::cout << "default" << std::endl; lang = QString::fromStdString("en_US"); } std::cout << lang.toStdString() << std::endl; translator.load(":/translation/" + lang + ".qm"); a.installTranslator(&translator); MainWindow w; w.update(); w.show(); return a.exec(); }