kossebau added a comment.

  Right, I forgot I wanted to check all the hits in lxr.kde.org first, but 
seems I called arc too early.
  And checking the QWidgets also should have been done, at least 
QCalendarWidget also has no NOTIFY on interesting properties. Meh.
  
  So what about this
  
  To fix the issue with possibly conflicting global settings of the property to 
use via the `propertyMap()` or indirectly the "kcfg_property" (which then is 
also stored into that global property map), we introduce a new additional way 
to control per widget instance what property to use (if not the USER one). One 
would store the name in the dynamic property "kconfig_property". Or 
alternatively "kcfg_property" could be kept used, and another dynamic property 
would mark that this one is only for this widget, e.g. "kcfg_propertyForWidget" 
= true.
  The second variant might be nicer, as it allows simply forward compatibility, 
so existing code could start adding that property for all the widget instances, 
would still work with old KF versions and for KF >=5.31 it would start working 
as intended, and no longer result in possibly conflicting registrations (none 
known to me, but there is a chance with apps with many settings from plugins, 
like System Settings, KDevelop, etc.).
  For KF6, where the global maps would be dropped, then the 
"kcfg_propertyForWidget" would be useless, but there could be a warning check 
in debug builds pointing out to remove this then deprecated flag from ones code.
  
  And together with that there would be another new property 
"kconfig_propertyNotify" or similar, via which for a given widget instance the 
signal to use would be passed (and only for this instance, not all of the class 
type). So with Ark's code it would be:
  
    // Set the custom property that KConfigDialogManager will use to update the 
settings.
    kcfg_disabledPlugins->setProperty("kcfg_property", 
QByteArray("disabledPlugins"));
    kcfg_disabledPlugins->setProperty("kcfg_propertyForWidget", true);
    // Tell KConfigDialogManager to monitor the itemChanged signal for a 
QTreeWidget instance in the dialog.
    kcfg_disabledPlugins->setProperty("kcfg_propertyNotify", 
SIGNAL(itemChanged(QTreeWidgetItem*,int));
  
  What do you think?

REPOSITORY
  R265 KConfigWidgets

REVISION DETAIL
  https://phabricator.kde.org/D4130

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: kossebau, #frameworks
Cc: elvisangelaccio

Reply via email to