This commit adds several keywords to system settings' various options like Fonts,
Autostart, Colors, Formats, Themes etc. so that users are able to search these
options easily from the system settings.
This was added to Kirigami in
https://invent.kde.org/frameworks/kirigami/-/merge_requests/314
and simplifies and standardizes the creation of simple text-based
headers in OverlaySheet. This commit ports the Translations KCM's
OverlaySheet header to use it. This is the only place in
plasma-workspace where such a port is appropriate.
forgot to emit the change signal in a number of scenarios. this then
broke actually changing the order and removing items from the selection
because the signal is used to forward the current selection list to the
KConfigSkeleton. by not emitting the signal in all change scenarios we'd
effectively never update the stringlist inside the skeleton causing noop
saves.
in the hopes of increasing code clarity.
previously we had three distinct models. the model of languages, the
subset model of available languages (!selected), and the inverse model
of selected languages (!available).
this does make a lot of sense conceptually but also complicated the code
a whole lot because data needs to be shuffled and shared between the
three models. this lead to partial duplication in the data() function,
as well as the need for excess book keeping of the lists.
the new design takes a different approach: there is a single model of
all translations now. in the UI it gets filtered into the visual
incarnations: available and selected - these simply sort and filter as
necessary.
the actual languages are now objects to encapsulate their newly found
statefulness with the new languagecompleter tech. this also allows us to
move the actual mutation logic into the language itself. to on-demand
complete a language by installing missing packages one now calls
complete() on the language which in turn internally defers to the
various abstraction systems.
one unfortunate aspect is that the requirements for selected languages
is kind of divergent from available languages. for selected languages
their *configured* order matters. to enable this there is a secondary
list of languages purely for establishing the selection and selection
preference (i.e. order of use). this is a bit awkward but considering
this very minor divergent in requirements I didn't see justification to
make selected languages a completely separate model.
the refactor also, rather by accident, repairs the handling of missing
languages which probably broke at some point because of the excessive
book keeping work (the missing languages never showed up in the model)
the visualization of missing languages is also streamlined now by not
treating them as part of the model but rather a secondary list of codes
that are configured but not actually available on the system. this
reduces the visual presentation a bit (not that it was particularly
useful since you can't do anything with a missing language anyway) but
has the advantage that it means we can consider the base model of
languages const (Language instance are loaded at startup only) and also
removes some cruft from the qml code that purely existed to visualize
missing languages.
to be clear: the languages are still listed in a warning, but no longer
displayed in the listview.
the desktop style forces a bit of padding onto the indicator which
combined with implicit small sizing in a layout means the indicator
comes out waaaaaay too small as half the available space is padding.
disable padding entirely, we don't really need it here
this caused an unnecessary warning. when the list is empty the join
results in "" which is considered invalid for the reference of %2
leading to ki18n warning that not enough arguments were supplied. simply
return an empty string when the message is not visible
the recycler did not really serve a purpose here. the delegates are
fairly cheap and there's a very finite amount of them and the amount
isn't going to be in the thousands either
it did however cause spurious warnings because there is a space of time
where model and index isn't available to the delegate and so trying to
get a role out of the model would cause warnings because model is null
initially.
removing the recycler gets rid of the warnings.
I've also changed parent.width to refer to the view explicitly as parent
isn't necessarily defined right out the gate causing excess warnings.
this is also typically what we do in other places.
To be consistent with what we generally do in other places, use the
trashcan icon for the remove button, and only show it when the list has
more than one item in it.
BUG: 437567
BUG: 437566
FIXED-IN: 5.22
since the packagekit bit for installing missing packages is optional it
may be that on ubuntu-like platforms workspace gets built without
packagekit and if that is the case then we can skip over the entire
completion checking as well since we'll have no means to complete an
incomplete language. worse yet, since we don't have any install logic
the relevant UI bits won't do anything
CCBUG: 437416
if the condition is covering the entire function then we can simply
return early, get less nesting depth and quicker exit condition reading
as you don't have to scroll down to see if anything happens after that
huge if
This matches the install location scheme QT_PLUGIN_DIR/kcms/, which makes
it slightly easier to test stuff right from the builddir, without
installation, by exporting QT_PLUGIN_DIR=builddir/bin/.
Also install kcm_fontinst in QT_PLUGIN_DIR/kcms/, like the other KCMs.
Removing the only item makes no conceptual sense, so let's not permit
it. Likewise, when there's only one item, it can't be moved to the top
since it's already at the top, so let's not show that one either.
BUG: 397978
FIXED-IN: 5.21