Dynamically show and hide based on whether or not any vaults are configured

Authored by ngraham on Jan 5 2020, 11:30 PM.

Description

Dynamically show and hide based on whether or not any vaults are configured

Summary:
Currently, the Vaults icon is always visible in the System Tray. However most tray icons
dynamically show and hide themselves based on whether or not they're relevant and in use,
which results in a nice clean clutter-free System Tray. So it would be nice for Vaults
to do the same.

This patch implements that behavior by making rowCount a property that gets updated
based on vault creation and deletion, and making the icon only appear in the tray when at
last one vault has been created. People who prefer to have it always visible can of course
override this in the System Tray settings, but the auto-hide behavior in this patch is probably
a better default for most.

Test Plan:

  1. Have no vaults -> icon is only in the popup
  2. Create a vault -> icon appears in the tray
  3. Delete the vault -> icon disappears from the tray and lives in the popup again

Reviewers: broulik, ivan, Plasma, VDG

Reviewed By: ivan, Plasma

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D26447