ba44b69abf added logic to handle apps that
use an absolute path in their .desktop file to define their icon, which
works. However in the process it introduced a subtle bug: if the icon is
not an absolute path and it's just a normal icon name, when
QFileInfo::exists() checks for the existence of that string, it will
treat it as a relative file path and therefore look for it in the
current working directory, which is typically the user's homedir. If it
finds something, it will go down the wrong code path and end up
returning a blank QIcon. This can be verified by adding a folder with
the name of an app icon into ~ and restarting plasmashell; that app in
Kickoff will have a blank icon.
To fix this, the icon loading code now first checks whether the icon
returned by m_service->icon() is actually an absolute path. If not, it
skips the logic to look for it on disk and goes straight to the
codepath that looks for an icon with that name in the icon theme.
To minimize disk reads, it checks for absolute-file-path-ness by
inspecting the string returned by m_service->icon() rather than using
QFileInfo::isAbsolute(), because this is a hot code path and most icons
will not have relative paths, so checking the disk for every one of
them would be a waste of resources.
BUG: 457965
FIXED-IN: 5.24.7
(cherry picked from commit 57d55e386a)
Having the right url is needed for drag and drop to work
For the recentdocuments runner we can just take the result
For the services runner the result is of the form "applications:org.kde.foo.desktop", so extract the service name from that
BUG: 456984
A few KDE versions ago, the KCM and app results were provided by the same plugin.
To make sure they do not appear very far down the list, the plugin id is inserted right after the services runner.
CCBUG: 446239
(cherry picked from commit fcbb1de7a8)
Use icu transliterator to convert i18n'ed name into ascii for initial
character grouping. Since AppsModel does not use group(), just use group
to store this value for convenience.
Relevant qt feature request for having a new mode for section:
https://bugreports.qt.io/browse/QTBUG-91258
Strategy used by this code mainly focused on CJK language.
1. Japanese locale will group all Han script together.
Katakana will be converted to hiragana.
2. Hangul will decompose and use consonant as group name.
3. Han will use icu "Han-Latin" transliteration to convert to pinyin.
BUG: 433297
BUG: 427530
Hunting this one down since mid-March...
In "native" Plasma containments like the panel, desktop, and plasmawindowed, the `LogindSessionBackend` in `libkworkspace` enters the "Ready" state nearly instantly, before any signals can even be attached. In other containments like Latte Dock and plasmoidviewer, however, the initialization takes some time to complete (unsure why). RootModel was not watching or waiting to check what the session backend's state was, resulting in validity checks being done too soon and never checked again.
This allows 3rd parties to provide additional actions in the context
menu of applications in kicker, kickoff,... by supplying suitable
desktopfiles in GENERIC_DATA_LOCATION/plasma/kickeractions similar
to mechanism used for service menues.
Entries for which the actions are displayed can be controlled by
X-KDE-OnlyForAppIds in the [Desktop Entry], for example
X-KDE-OnlyForAppIds=org.kde.kate,org.kde.dolphin
This was requested as a patch for steam, but we've made a generic
solution so that it can be used by everyone.
In the past, application Favorites were stored with their .desktop file path
such as "/usr/share/applications/org.kde.dolphin.desktop". But now those
entries are stored like so: "applications:org.kde.dolphin.desktop".
This commit converts old DB entries to the new style, which solves the issue
of users with old databases being unable to change their Favorite items.
BUG: 385814
FIXED-IN: 5.24.5
When creating a new KService, it will try to read the file as a desktop
file, but if the file is a large non-desktop file, it will hang for a
long time.
Verify the file is a desktop file, and if not, skip creating KService
and run the match directly.
BUG: 442970
FIXED-IN: 5.24.4
BUG: 401579
FIXED-IN: 5.25
Best used in conjunction with with
https://invent.kde.org/frameworks/kio/-/merge_requests/780 which will
allow kicker recentUsageModel not to make any stat call but solely
base its iconName based on passed mimetype, allowing to act as if
KFileItem::SkipMimeTypeFromContent was set.
If we have multiple sources for the application, we end up with multiple entries.
This is not useful in any scenario, because the generated appstream URL
is exactly the same.
Consequently we should return from the function when we created the first action.
BUG: 448564
The triangle mouse blocks events that happen within a given region and
conditions, then replays those events when those conditions get broken.
If we intercept an enter event, we capture that under
m_interceptedHoverItem so that if conditions change we can replay that
hover enter event before we then start sending move events.
Currently we replay that hover event using the current mouse position.
This causes an issue for kickoff that has additional code to look for
actual move events in order to avoid selecting the current item on
scroll. Both codepaths are correct standalone, but together form a bug.
This patch caches the relative position of a HoverEnter event. Should we
replay the enter event, we do so with the position of the enter. We then
can replay a HoverMove to get the up-to-date location.
BUG: 447278
Qt's foreach is deprecated and should be replaced with modern C++
range-for loops. Const qualifiers are added to variable declarations
and wrapper in std::as_const as required to prevent unnecessary
clones/detach.
Qt's foreach is deprecated and should be replaced with modern C++
range-for loops. Const qualifiers are added to variable declarations
and wrapper in std::as_const as required to prevent unnecessary
clones/detach.
And factored out some duplicated code on the way.
Arguably, `found=false; for(list) {if(cond) {found=true; break;}}` is
harder to read than a single `found=array.contains(cond)` expression.
My only regret is that C++ does not provide any `contains()` function /
algorithm, so we are forced to `find_if` an element and compare it with
an iterator's `end()` which would be an utter nonsense in any other
language.
But most importantly, this commit replaces Qt's deprecated foreach with
a standard for-loop.
Needs c815c7a9bc
Currently the logic is very fragile and depends on the data being an url.
However the data of the match is an implementation detail and is in case of the KCM matches
a KPluginMetaData instance.
To avoid this issue the first url of the QueryMatch::urls() return value is checked.
This data is intended for mime-type/scheme related operations.
In the future we need an extra url for systemsettings & should consistently use the
urls of the query match. I will work on this before continuing to port the
plasma KCMs from KServiceTypeTrader.
BUG: 442522
This was deprecated, because having string based key-actions values
does not fit the usecases we have.
Consequently we should check if the runner has any QAction children, this
works if the runner created the QActions manually or if the actions
are registered in the abstract runner.
Also we can drop the ugly hack.
PlasmaQuick::Dialog has it's own WindowType which should be set instead,
otherwise once set NET::WindowType gets smashed by consequent
DialogPrivate::applyType() calls
BUG: 378694