- basename() returns the last path component, so never includes
the leading '/dev/'
- the check for mmc and nvme looked for device names starting
with '/dev/mmc' .. but '/dev/' has just been stripped away
by the call to basename, so this never matched
- stripped the trailing digits rather than trailing 'p[0-9]',
so 'nvme0n1p2' became 'nvme0n1p' which isn't a useful
device name.
FIXES#1883
Don't do the actual KPM work, but pretend that they were done.
This can be useful -- independently of the existing unsafe-
options and failing partitioning entirely -- for testing
partition layouts in modules following the *partition* one.
- the length parameter to diskDescription() is worse than
useless, because it doesn't say anything about what will
be done if there's more than one disk.
If there are no modules at all before an exec: section is
reached (e.g. right now due to a bug in module-loading)
then the last() call would crash. Instead, use a nullptr
for the last-module-loaded.
While here, apply code-formatting.
If the hostname changes while the field has focus, that means
that the user is typing in the field, and we shouldn't mess
with the cursor position.
FIXES#1884
- use clang-format12 or 13 or unversioned executable, only
- check it's actually 12 or 13
- set language standard explicitly to C++17, "Cpp11" is now
an alias for "latest" which is weird
This change does lead to some thrashing when applying styles,
so I'm not going to do that across the board right now. Changes include:
- extra spaces in lambda-captures
- nicer alignment of lambda-bodies
- if nothing is selected (index -1, which now shows the placeholder), the text is empty
- if something has been entered, return it (e.g. if the user is typing)
- if something is selected, the text gets set to that anyway
The warning about the mount point -- that it was in-use or
invalid -- had been separated from the drop-down by the
FSLabel field. Move it back, rename the variable for
clarity while we're at it.
- make the boxes expand, rather than stick to a minimum
size that doesn't align with other boxes in the dialog,
and which may be too small to contain the text they display.
Avoid logs like
23:29:57 [2]: void Config::setConfigurationMap(const QVariantMap&)
WARNING: Configuration for *initialSwapChoice* is not one of the *userSwapChoices*
WARNING: .. Choice "small" added.
where the label is duplicated.
There is a mismatch between how the configuration interprets
*initialSwapChoice* when it is not a valid choice, and how
the UI interprets it. If you e.g. do not have a *userSwapChoices*
setting at all, whatever *initialSwapChoice* is set is interpreted
by the UI as "suspend".
Avoid that by putting the choice in the configuration and
warning the user (which ought to be a warning to the distro).
FIXES#1881