KMessageBox runtime dependency on FrameworkIntegrationPlugin makes it useless
David Faure
faure at kde.org
Tue Jun 14 08:57:19 UTC 2016
On mardi 14 juin 2016 01:00:09 CEST Albert Astals Cid wrote:
> El dilluns, 13 de juny de 2016, a les 11:27:53 CEST, David Faure va
escriure:
> > On dimanche 12 juin 2016 22:58:34 CEST Albert Astals Cid wrote:
> > > El diumenge, 12 de juny de 2016, a les 20:29:56 CEST, Christoph Cullmann
> > > va
> > >
> > > escriure:
> > > > Hi,
> > > >
> > > > > Having KMessageBox "dontShowMeAgain" feature depend on an
> > > > > integration
> > > > > plugin is a very bad idea.
> > > > >
> > > > > Basically it means programs that use KMessageBox can never asusme it
> > > > > will
> > > > > work so basically they have to use alternative methods to have the
> > > > > "dontShowMeAgain" feature or not have it at all.
> > > > >
> > > > > I understand someone thought that it was a better idea having a
> > > > > feature
> > > > > that may work or not randomly that increasing the dependency chain
> > > > > of
> > > > > KMessageBox, but I disagree.
> > > > >
> > > > > I don't think the status quo is good at all, my program basically
> > > > > gets
> > > > > a
> > > > > runtime dependency that is not specified anywhere and that makes
> > > > > some
> > > > > features work or not randomly.
> > > > >
> > > > > The options I can see are:
> > > > > * Remove the "dontShowMeAgain" feature from KMessageBox
> > > > > * Make the "dontShowMeAgain" feature use QSettings (always or if
> > > > > FrameworkIntegrationPlugin is not available)
> > > > > * Show a KMessageBox warning when trying to use the
> > > > > "dontShowMeAgain"
> > > > > feature and the FrameworkIntegrationPlugin is not available saying
> > > > > the
> > > > > user to install that package if he wants to get the functionality.
> > > >
> > > > I would go for the "just use QSettings always" solution.
> > >
> > > This has two problems:
> > > * Someone needs to care about a way to read the KConfig and write it to
> > >
> > > QSettings so it still works for people that had already checked "don't
> > > show
> > > me again"
> > >
> > > * There's a KMessageBox::setDontShowAgainConfig(KConfig *cfg) that
> > > would
> > >
> > > break, this affects only the kdialog app and KIO::JobUiDelegate
> > >
> > > The second is probably "workaroundable" but i'm not sure how one would
> > > approach the first.
> > >
> > > Maybe still using the FrameworkIntegrationPlugin to check if the option
> > > has
> > > been set and if it has and it is not in qsettings, move it there?
> > >
> > > This would "fail" if the FrameworkIntegrationPlugin is not there, but
> > > that
> > > would mean that most probably the kconfig was never ever set either
> > > (unless
> > > you installed FrameworkIntegrationPlugin used a kmessagebox and then
> > > uninstalled FrameworkIntegrationPlugin that seems very corner case-y).
> > >
> > > I'll try to work on this in the coming days if noone disagrees.
> >
> > Not sure exactly what is your final approach, from the above.
> >
> > I would go for:
> > Make the "dontShowMeAgain" feature use QSettings if
> > FrameworkIntegrationPlugin is not available
> >
> > i.e. as a fallback. This preserves the KConfig benefits/integration on a
> > more complete install, but doesn't lead to a non-working checkbox when the
> > plugin is missing.
>
> That is not what i suggested, I suggested using QSettings only.
>
> What's the point of using KConfig for this?
I can think of the following:
- not breaking setDontShowAgainConfig(KConfig *cfg)
- not breaking application code that might be setting or clearing
these settings directly using KConfig (e.g. to implement "show all messageboxes
again")
- (and then you don't have to handle any migration, so it's actually much
simpler IHMO)
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list