lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
193 stars 135 forks source link

Plugin numbering when adding plugins is unexpected #2126

Open isf63 opened 2 months ago

isf63 commented 2 months ago

I've never been able to predict the panel plugins' numbering when adding plugins. It presents no significant issue to the end user, but they may be confused by the numbering displayed in Configure Panel -> Widgets. It also confuses people who look at ~/.config/panel.conf.

Expected Behavior

Plugin numbering when adding new plugins coincides with what exists in panel.conf

Current Behavior

Plugin numbering when adding new plugins is hard to predict. (May be fixed by restarting the panel after deleting plugins.)

Possible Solution

Read panel.conf upon adding a new plugin.

Steps to Reproduce (for bugs)
  1. Remove all panels but one and remove all plugins.
  2. Check ~/.config/lxqt/panel.conf and confirm the only sections are [General] and one for the panel.
  3. Manage Widgets -> Add -> and add one of every plugin type.
  4. Observe how about half of the plugins say "2" (e.g. "volume2"), despite no others existing.
System Information
tsujan commented 2 months ago

Yes, it was also weird to me many years ago, but since there was no real problem, I overlooked its ugliness. I might not find the time to look into it soon but will review PRs.

isf63 commented 1 month ago

@tsujan, I think I found the cause.

This seems to be the offending function.: https://github.com/lxqt/lxqt-panel/blob/3126cdde0149e272c442a1b00323b3c68a216e02/panel/panelpluginsmodel.cpp#L285

What it going on that causes, e.g. volume2 instead of volume, is that QStringList groups = mPanel->settings()->childGroups(); is including /usr/share/lxqt/panel.conf's group names in its list.