ensured building on latest archlinux system

This commit is contained in:
leca 2024-12-01 19:37:17 +03:00
parent 88d849bee9
commit 362c70e695
9 changed files with 27 additions and 54 deletions

View File

@ -5,7 +5,6 @@
#include <opencv2/imgproc.hpp>
#include <string>
#include <opencv2/core/mat.hpp>
//#include <QColorTransform>
#include <QFileDialog>
#include <QMessageBox>
#include <zbar.h>

View File

@ -5,29 +5,16 @@
#include <QApplication>
#include <curl/curl.h>
#include <iostream>
#if __GNUC__ < 8
#if __GNUC__ < 8 && __clang_major__ < 17
# include <experimental/filesystem>
using namespace std::experimental::filesystem;
#else
# include <filesystem>
using std::filesystem;
using namespace std::filesystem;
#endif
#include <fstream>
#include <QTranslator>
int main(int argc, char *argv[]) {
// std::ifstream test_file("/home/leca/projects/qt/checks-parser/test.html");
// std::string content;
// std::string str;
// while(getline(test_file, str)) {
// content += str + "\n";
// }
// parseOfdRuAnswer(content);
// return 0;
curl_global_init(CURL_GLOBAL_ALL);
std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser");

View File

@ -7,7 +7,6 @@
#include "adjustpicturedialog.h"
#include "settingsdialog.h"
#include "solvecaptchadialog.h"
#include <iostream>
#include <QFileDialog>
#include <QMessageBox>
#include "image/checkimage.h"
@ -38,14 +37,6 @@ void MainWindow::setupStoresList() {
QString s = QString::fromStdWString(module_name);
ui->storeType->addItem(s);
}
#ifdef DEBUG
for (auto module : parser.search_modules()) {
std::cout << "Module: " << module << std::endl;
}
#endif
}
std::string MainWindow::makeRequestToOfd(std::string captcha) {

View File

@ -5,7 +5,6 @@
#include <QFileDialog>
#include <QMainWindow>
#include <fstream>
#include <iostream>
#include "settings/settings.h"
#include "utils/utils.h"
@ -50,8 +49,6 @@ void OutputDialog::on_buttonBox_accepted() {
int position = ui->tableWidget->item(i, 0)->text().toInt();
std::string name = ui->tableWidget->item(i, 1)->text().toStdString();
std::cout << position << " " << name << std::endl;
Column c;
c.type = static_cast<ColumnType>(i);
c.position = position;

View File

@ -5,12 +5,12 @@
#include "../utils/utils.h"
#include <iostream>
#if __GNUC__ < 8
#if __GNUC__ < 8 && __clang_major__ < 17
# include <experimental/filesystem>
using namespace std::experimental;
#else
# include <filesystem>
using std::filesystem;
using namespace std::filesystem;
#endif
Parser::Parser() {}
@ -18,10 +18,10 @@ Parser::Parser() {}
std::vector<std::string> Parser::search_modules() {
Settings s(get_path_relative_to_home(".local/share/checks_parser/settings.json"));
std::string path = get_path_relative_to_home(s.get_setting("stores_modules_dir"));//std::string(std::getenv("HOME")) + "/" + STORES_MODULES_DIR;
filesystem::directory_entry modules_dir(path);
directory_entry modules_dir(path);
if (!exists(modules_dir)) {
filesystem::create_directories(path);
create_directories(path);
std::cout << "No modules directory found. Created one at " << path
<< std::endl;
std::cout << "Please, download modules to that directory from my git."
@ -30,7 +30,7 @@ std::vector<std::string> Parser::search_modules() {
std::vector<std::string> modules_files;
for (auto file : filesystem::directory_iterator(path)) {
for (auto file : directory_iterator(path)) {
modules_files.push_back(file.path());
}
@ -74,11 +74,11 @@ std::vector<std::string> Parser::check_updates() {
std::vector<std::string> to_download;
std::vector<std::string> stored_modules;
filesystem::directory_entry modules_dir(path);
directory_entry modules_dir(path);
if (!exists(modules_dir)) {
filesystem::create_directories(path);
create_directories(path);
}
for (const auto& file : filesystem::directory_iterator(path)) {
for (const auto& file : directory_iterator(path)) {
if (!is_regular_file(file)) continue;
stored_modules.push_back(file.path().filename());
std::cout << file.path().filename() << " detected store module" << std::endl;

View File

@ -4,18 +4,18 @@
#include <string>
#include "../utils/utils.h"
#if __GNUC__ < 8
#if __GNUC__ < 8 && __clang_major__ < 17
# include <experimental/filesystem>
using namespace std::experimental;
#else
# include <filesystem>
using std::filesystem;
using namespace std::filesystem;
#endif
Settings::Settings(std::string path) {
this->settings_file_path = path;
if (!filesystem::exists(path)) {
if (!exists(path)) {
std::ofstream output(path);
nlohmann::json settings = R"({
@ -60,8 +60,8 @@ Settings::Settings(std::string path) {
this->settings = settings;
}
filesystem::create_directories(get_path_relative_to_home(this->settings["ofds_modules_dir"]));
filesystem::create_directories(get_path_relative_to_home(this->settings["stores_modules_dir"]));
create_directories(get_path_relative_to_home(this->settings["ofds_modules_dir"]));
create_directories(get_path_relative_to_home(this->settings["stores_modules_dir"]));
}
void Settings::write_setting(std::string setting, std::string value) {

View File

@ -2,7 +2,6 @@
#include "settings/settings.h"
#include "ui_settingsdialog.h"
#include "utils/utils.h"
#include <iostream>
SettingsDialog::SettingsDialog(QWidget *parent)
: QDialog(parent), ui(new Ui::settingsdialog),

View File

@ -14,12 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../adjustpicturedialog.cpp" line="40"/>
<location filename="../adjustpicturedialog.cpp" line="39"/>
<source>QR code was not detected on that image. Please edit it again or enter data manually</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../adjustpicturedialog.cpp" line="42"/>
<location filename="../adjustpicturedialog.cpp" line="41"/>
<source>No QR code</source>
<translation type="unfinished"></translation>
</message>
@ -140,22 +140,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="94"/>
<location filename="../mainwindow.cpp" line="85"/>
<source>Captcha was not solved correctly!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="96"/>
<location filename="../mainwindow.cpp" line="87"/>
<source>Captcha is incorrect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="101"/>
<location filename="../mainwindow.cpp" line="92"/>
<source>Check not found. Please, ensure correctness of entered data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="103"/>
<location filename="../mainwindow.cpp" line="94"/>
<source>Check was not found</source>
<translation type="unfinished"></translation>
</message>

View File

@ -14,12 +14,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../adjustpicturedialog.cpp" line="40"/>
<location filename="../adjustpicturedialog.cpp" line="39"/>
<source>QR code was not detected on that image. Please edit it again or enter data manually</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../adjustpicturedialog.cpp" line="42"/>
<location filename="../adjustpicturedialog.cpp" line="41"/>
<source>No QR code</source>
<translation type="unfinished"></translation>
</message>
@ -140,22 +140,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="94"/>
<location filename="../mainwindow.cpp" line="85"/>
<source>Captcha was not solved correctly!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="96"/>
<location filename="../mainwindow.cpp" line="87"/>
<source>Captcha is incorrect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="101"/>
<location filename="../mainwindow.cpp" line="92"/>
<source>Check not found. Please, ensure correctness of entered data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="103"/>
<location filename="../mainwindow.cpp" line="94"/>
<source>Check was not found</source>
<translation type="unfinished"></translation>
</message>