From b8fb6d361c382dd13c615ad4f5f4e5ac0e7741c4 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 24 Jan 2022 16:38:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=BE=D0=B5=20=D0=B8?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- sdp-sniffer-qt.pro | 2 +- src/MainWindow.cpp | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2ce043..0cdaeba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.21) project(sdp_sniffer_qt) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) diff --git a/sdp-sniffer-qt.pro b/sdp-sniffer-qt.pro index cfba9e6..5c5559e 100644 --- a/sdp-sniffer-qt.pro +++ b/sdp-sniffer-qt.pro @@ -2,7 +2,7 @@ QT += core gui serialport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -CONFIG += c++20 +CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 2e0e892..e04e578 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -18,23 +18,23 @@ MainWindow::MainWindow(QWidget *parent) updatePortsList(); // это перегон текстовика с заранее сохраненными пакетами - std::fstream f("/home/vlad/Documents/sniffer-dir/test6.txt", std::ios_base::in | std::ios_base::binary); - if (f.good()) { - do { - char chars[22]; - f.read((char*) chars, 22); - if (f.good()) { - for (char c: chars) { - printf("%c", c); - putCharToMessage(c); - } - } else { - break; - } - } while (!f.eof()); - ui->log->appendHtml("[INFO] Файл c данными прочитан. Там " + QString::number(messages.size()) + " записей\n"); - } - f.close(); +// std::fstream f("test6.txt", std::ios_base::in | std::ios_base::binary); +// if (f.good()) { +// do { +// char chars[22]; +// f.read((char*) chars, 22); +// if (f.good()) { +// for (char c: chars) { +// printf("%c", c); +// putCharToMessage(c); +// } +// } else { +// break; +// } +// } while (!f.eof()); +// ui->log->appendHtml("[INFO] Файл c данными прочитан. Там " + QString::number(messages.size()) + " записей\n"); +// } +// f.close(); } MainWindow::~MainWindow() {