aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2022-10-14 12:04:20 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2022-10-14 12:04:20 +0200
commitfc0c27fd93be4fbd202f19647715f38650f06564 (patch)
tree31d4b1c0610cde2b6b00c869d91b40a32686440d /src/input
parent5f037f3a15456cc4dc4dff55f30cf6144f41cb02 (diff)
downloaddabmux-fc0c27fd93be4fbd202f19647715f38650f06564.tar.gz
dabmux-fc0c27fd93be4fbd202f19647715f38650f06564.tar.bz2
dabmux-fc0c27fd93be4fbd202f19647715f38650f06564.zip
load_entire_file: display Loaded X bytes from Y message when the content changes
Diffstat (limited to 'src/input')
-rw-r--r--src/input/File.cpp3
1 files changed, 2 insertions, 1 deletions
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<uint8_t> 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;