https://bugs.kde.org/show_bug.cgi?id=522885

            Bug ID: 522885
           Summary: Kickoff applet hides all system actions (including
                    Sleep) when systemFavorites config key is absent
    Classification: Plasma
           Product: plasmashell
      Version First master
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Application Launcher (Kickoff) widget
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: 1.0

STEPS TO REPRODUCE
1. Ensure a clean/default Kickoff configuration (no systemFavorites or
primaryActions keys in the config file).
2. Open the Kickoff application launcher.
3. Observe the Leave / session action buttons area at the bottom.

EXPECTED BEHAVIOR
When systemFavorites and primaryActions are not configured, the Leave buttons
area should fall back to showing all available system actions: Lock Screen, Log
Out, Switch User, Sleep, Restart, Shut Down.

ACTUAL BEHAVIOR
The Leave buttons area is empty - NO system action buttons are displayed at
all, including the Sleep button.

ROOT CAUSE
The systemFavoritesContainsRow function in LeaveButtons.qml uses:
  String(Plasmoid.configuration.systemFavorites).includes(favoriteId)
When systemFavorites config key is absent,
Plasmoid.configuration.systemFavorites returns undefined.
String(undefined) returns the literal string "undefined", so .includes()
returns false for EVERY entry.
Since this function is used as the filterRowCallback for a
KSortFilterProxyModel, ALL rows are filtered out.

WORKAROUND
Set the following in the config:
  primaryActions=3
 
systemFavorites=lock-screen,logout,save-session,switch-user,suspend,hibernate,reboot,shutdown

SUGGESTED FIX
Add a check for undefined at the start of systemFavoritesContainsRow:
  if (Plasmoid.configuration.systemFavorites === undefined) return true;

SYSTEM: Plasma 6.7.2-1, kitemmodels 6.27.0-1, Qt 6.11.1-1, Arch Linux, Wayland

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to