This if() condition checks the result of seek, write, flush
and fsync. The first three are methods on QFile, so return
a truthy value on success. write() returns number of bytes
written while seek() and flush() return bool true on success.
Therefore they have to be inverted to detect errors. However,
fsync() is a posix system call, so it returns zero (false) on
success. Therefore it should not be inverted.
Note that currently this entire code block can never run.
knownsize is always zero because QFile.size() currently
cannot determine the size of a block device. However, when I
asked to confirm this behavior, a Qt maintainer decided to
implement it, so there is now a PR. If that is released then
this code block will become live and the reversed fsync check
will cause a problem.
PR: https://codereview.qt-project.org/c/qt/qtbase/+/581443
gpt.Signature is not a null-terminated string, but an 8-byte character array. Using `strcmp` will not provide a valid result. Use `strncmp` over the first 8 bytes instead.
Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
The keyboard: section should be used instead, which should do the right
thing on whatever platform cloud-init is being used on (writes
/etc/default/keyboard on Debian/Ubuntu, uses localectl on RHEL/Fedora,
runs setup-keymap on Alpine).
[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038762
[2]: 2030788
On systems with a very large number of snap packages installed, there
are a considerable number of loop devices. In this case, the `lsblk`
command in linuxdrivelist fills the stdout pipe, blocks, and the
rpi-imager process assumes it has timed out [1].
This is a trivial work-around that simply excludes loop devices
(major=7) from the `lsblk` output. Given subsequent code excludes
everything starting with `/dev/loop` anyway, there should be no change
in user experience with this exclusion.
[1]: https://github.com/waveform80/imager-snap/issues/6
Makes the filtering-behaviour userconfigureable during compile-time.
This way its easier to configure the imager for flashing SATA or NVME
Drives installed in your system (because of lack of adapters),
or if the drives are (accidentally) labled as systemdrives by drivelist.
tr() is not safe for strings that you move between contexts,
as it fails to provide a mechanism for specifying the context
of the string.
Regenerate the translation files, and use QCoreApplication to locate
the real translations.
Additionally, bodge a race condition between translator replacement
and OS list fetching, by marking the OS list as something to be
re-calculated on a translator change.
Fixes#799
But, as a consideration for users wanting to verify their password, add a 2s dwell time before the characters are masked. This timeout is prematurely terminated in the event that you enter another key.
Using onTextEdited meant that the clear() call would happen after the edit had actually happened.
Instead, use the Keys.onPressed handler, which happens earlier in the input chain.
Since #719, you can no longer use a local json file with --repo (At least in Qt 6). A network request to a file:// url has statusCode 0, which caused this check to fail previously.