The value inside a unique_ptr can't be opaque, it needs to be known
at any site where the pointer may be deleted. shared_ptr does not
have that (deletion is part of the shared_ptr object, which is larger
than the unique_ptr) and so can be used for opaque deletions.
The QLatin1String() might be replaced by char[], that trades one
initialization for two but with a simpler data section; this
probably is not worth profiling.
With Qt 5.15.2 (and clang), `k->first` works, but this breaks
with Qt 5.11 (and gcc), this is not available and the dereference
must be written differently, `(*k).first`.
- This kind of runs around the selection model on the view,
but we're drawing radio buttons ourselves **anyway**
and the list of themes knows which is selected / current
independent of the view.
- make ThemeInfo and ThemeInfoList internal, expose only
ThemesModel to the rest of the PlasmaLnF module
- don't build the widget anymore (needs to be replaced by
a delegate)
- also individual changes need to be signalled
- use QSignalBlocker to avoid spamming changes when calling
aggregate change methods
- refactor findById() so that also a row number can be
obtained, which is needed for the change signals.
- put a filter model in place, so only the themes with "show" set
are displayed
- rip out the messing about with widgets, soon to introduce a model-
based UI
This is the bugfix part (rather than the "clean up this widgets mess")
of issue-1573, ensuring that the LookAndFeelPackage setting is
saved to the target system config file.
- Need to update the variant that is in use, **and**
explicitly update it in the widget, in order to re-load
the keyboard image for the newly-selected layout+variant.
- Make explicit which one runs in the host, which one is selectable.
- Document *location* parameter in the selectable version.
- Tidy up alignment of apidox.
The lookandfeeltool does not (always?) write the LookAndFeelPackage
key that the KCM does -- and which this module reads on startup
to find the default LnF. This seems to be a regression in recent
lookandfeeltool versions (or in the KCM code that backs it).
Workaround supplied by jghodd.
Fixes#1573
The module preserves the extended attributes at rsync and the overlay
filesystem stores extended attributes by inodes.
The overlay filesystem keeps traces of the lower directory by encoding
and storing its UUID to the attribute trusted.overlay.origin. If the
index feature is on, that attribute is compared to the UUID of the lower
directory at every subsequent mounts and causes mount to fail with
ESTATE if it does not match.
This filters the namespace trusted.overlay.* by using the rsync option
--filter='-x trusted.overlay.*' to make sure the overlays extended
attributes are not preserved.
Fixes:
# mount -t overlay -o lowerdir=...,upperdir,...,workdir= overlay /mnt/etc
mount: /var/mnt/etc: mount(2) system call failed: Stale file handle.
# dmesg
(...)
overlayfs: "xino" feature enabled using 32 upper inode bits.
overlayfs: failed to verify origin (/etc, ino=524292, err=-116)
overlayfs: failed to verify upper root origin
Previously, the auxerror information was never stored, and
the messages were all un-numbered or un-explained.
Now, consume that information and store it when check()
is called, ready to be used when (possibly much later,
or after a translation change) explanation() is called.
Mount guesses the filesystem if it is unset or if it is set to auto,
thanks to blkid. That is the case for the bind mountpoints like /dev or
/run/udev in mount.conf. See `mount(8)` for more details.
The drop-down of zones was initially unfiltered, so you could start
in Europe/Amsterdam and the zones drop-down would also show Australian
zones; picking Perth would have weird effects, since Europe/Perth
doesn't exist and so you'd end up in New York instead.
- set the filtering region immediately, rather than only when the
region changes.
Various file writes were not being checked, and the code
was a bit tangled; specifically keyboardq did **not**
configure properly on KaOS and now seems ok.
The root mount-point can end with a / while the mount-point read from
the file /etc/mtab does not end with a /.
This leads to skip the unmounting of the root mount-point and causes the
removal of the root mountpoint directory to fail with EBUSY because it
is still mounted.
This uses the python functions os.path.normpath() to normalize the root
mount-point (i.e. to drop the trailing /) and os.path.commonprefix() to
determine the longest common prefix between the two mount-points. If the
returned prefix is identical to the normalized root mount-point then the
mount-point must be added to the list of the mount-points to unmount.
More generally, the python modules should rely on the os.path functions
to compare for paths instead of using strings. It covers this way lots
of corner cases (path with "//", "/../", "/./", ...).
- put the writing of each kind of file in its own block -- this should
become separate functions -- so that variables become more local
and debugging can be improved.
- while here, fix the error message for /etc/default/keyboard:
it would complain and name the vconsole file path if it ever failed.
- factor out the flags-we-want from the flags-we-already-have
- the use of ->activeFlags() meant that the state on *disk* was
being compared with the flags-we-want; if a partition was re-edited,
then you couldn't change the flags back to the state-on-disk
(eg. enable a flag, then change your mind and disable it).
- set the flags before refreshing the partition, because the
refresh checks for EFI bootability and that needs the new flags,
not the old ones.
- remove the m_defaultFSType from PartitionLayout, because it is
set on construction -- which is too early, before the configuration
has been read.
- make the default FS explicit in the init() calls which pass in
a configuration; this needs support in the intermediate
PartitionCoreModule.
- the "simple" constructor for PartitionEntry left the FS type
set as the constructor left it -- which is Unknown by default.
This leads to install failures in systems that don't set a
special layout but just want a single / -- because the FS is
set to Unknown.
- massage the constructor and consumer of the code, push
Ext4 FS in the tests and use the configured default in production.
The return of the call to libcalamares.utils.mount is never tested and
it may fail silently; this causes some mounpoints to be missing.
This adds a warning if mountpoint cannot be mounted.
chcon: failed to get security context of '/tmp/verity': Operation not supported
06:44:23 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "unformatted", "/dev/sdb2", "/tmp/calamares-root-kv8dqgb5/tmp/verity")
.. Finished. Exit code: 32
.. Target cmd: ("mount", "-t", "unformatted", "/dev/sdb7", "/tmp/calamares-root-kv8dqgb5/tmp/verity") output:
mount: /tmp/calamares-root-kv8dqgb5/tmp/verity: unknown filesystem type 'unformatted'.
Some compile flags changed recently, triggering assert()
in the jobqueue when there is more than one. There's no
real reason for JobQueue to be a singleton, but it wants
to be. So clean up pointers a little more enthusiastically.
- Use classes to prompt lupdate to extract with a better
context (e.g. the class name, rather than plain "QObject")
so that the translation-lookup can use the named context.
- Add hard-coded "default" variant
- Add totally bogus Tajik translations, for testing purposes
This is the Wrong Thing To Do, but we'll do it for now: build the
keyboard translations into the executable. In the medium term
they should move to the modules that use them, with the re-vamp
of how translation changes are signalled.
Now that Calamares is compiled as C++17, we get this:
src/modules/locale/timezonewidget/TimeZoneImage.cpp:28:55: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated]
/* static constexpr */ const QSize TimeZoneImageList::imageSize;
The code doesn't match the comment: there are no by-ref captures
in the code, and the shadowing of parameters and local variables
is confusing. Remove one variable that is passed in as an argument
(and just pass the value as argument) and copy-capture the other
rather than doing weird argument passing.
- remove unused this captures from lambda
- rename variables that are short, cryptic, and shadowed
- remove documentation for parameters that don't exist
This commit adds the new configuration `swapPartitionName` to the file
partition.conf.
This option sets the partition name to the swap partition that is
created. If this option is unset, the partition is left unnamed.
- only widgets get language change events, so we need to
hook that up to the ViewSteps and inform the Config
object so that it can (re)load translations for the
keyboard data.
- Rename the "size" locals using "sectors" in their name. Size may be
confusing or not enough specific as it can be interpreted a size in
Byte.
partSizeMap -> partSectorsMap,
totalSize -> totalSectors,
availablesize -> availableSectors,
size -> sectors,
minSize -> minSectors
maxSize -> maxSectors
- Create a the new local currentSector to iterate over the sectors;
instead of using the parameter firstSector.
- Remove the variable end that does not help much; too many variable
already. Expand its expression instead.
- Introduces new constructors for PartitionEntry: copy constructory and
constructor with all attributes.
- Use the new constructor in method addEntry().
- The variant helper toString() takes a default value since commit
c9f942ad6 ([libcalamares] Add default value to variant helpers).
- Set the default value to 0 and simplify the retreival of size values
by calling the helper toString() and removing the temporary variables.
- The logic of the method initLayout belongs to the object
PartitionLayout. Move logic to that object.
- Use a single method initLayout in object PartitionCoreModule.
- Member m_partLayout in object PartitionCoreModule is no longer
allocated.
The translation happens whenever this code is run, which may
not match the language the user subsequently selects.
It also causes general problems with the translation,
since we end up with a possibly-partly-translated name.
- With debugging and untangling done, the lambdas are simple
and short, so return to using them. One point of improvement
might be to give the models suitable slots themselves,
to avoid even this indirection.
- Use the just-refactored XKBListModel to store the xkb key-value
pairs for variants, drop most of the complicated implementation,
store just a single list of values.
- Remove code that is duplicated in Config.
- Hook up UI for physical keyboard model, and back.
- For now, introduce some named slots with debugging output.
This makes debugging a lot easier since we have function names
to work with rather than anonymous lambdas
- Config already *has* everythind, but drop the useless copies
and duplicated code from the Page
- Plug the models model into the Page
- While here, document the model / layout / variant distinctions
The code doesn't fill the UI properly, and the drop-down
for the models combobox is not right, but at least the data
is shared.