The current code gathers AppStream IDs by looking at the app's desktop
name and then adding ".desktop" onto the end of this, reflecting a
now-deprecated convention that every AppStream ID ought to end in
".desktop". This hasn't been true for a while and isn't correct today;
let's use a more modern API that returns more correct results.
BUG: 458812
FIXED-IN: 5.24.7
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
Those files may be executable and the user wants them to execute. For
example:
- Shell scripts the user has written to perform commonly-used actions
- Windows executables opened with WINE
For this reason, we should stop explicitly blocking running executable
files when accessed with KRunner runners or Kicker/Kickoff/Application
Dashboard, and instead show the typical "open or execute?" dialog that
respects the user's setting for what to do in this case.
BUG: 455924
FIXED-IN: 5.26
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
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.