From fc0c27fd93be4fbd202f19647715f38650f06564 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 14 Oct 2022 12:04:20 +0200 Subject: load_entire_file: display Loaded X bytes from Y message when the content changes --- src/input/File.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/input/File.cpp') diff --git a/src/input/File.cpp b/src/input/File.cpp index a4ef365..d9fe02a 100644 --- a/src/input/File.cpp +++ b/src/input/File.cpp @@ -140,6 +140,7 @@ ssize_t FileBase::load_entire_file() { // Clear the buffer if the file open fails, this allows user to stop transmission // of the current data. + vector old_file_contents = move(m_file_contents); m_file_contents.clear(); m_file_contents_offset = 0; @@ -179,7 +180,7 @@ ssize_t FileBase::load_entire_file() } while (r > 0); close(); - if (m_file_open_alert_shown) { + if (old_file_contents != m_file_contents) { etiLog.level(info) << "Loaded " << m_file_contents.size() << " bytes from " << m_filename; } m_file_open_alert_shown = false; -- cgit v1.2.3