Forward declare KLocalizedString and make I18n a private dependency.
Needs ReviewPublic

Authored by daandemeyer on Jul 26 2019, 10:47 PM.

Details

Reviewers
None
Group Reviewers
Frameworks
Summary

When refactoring Kate's CMake scripts, I was looking into why a target got an interface dependency on I18n when linking against KTextEditor and I tracked it down to KTextWidgets. Since there's only one small usage in a single widget that can be forward-declared it seems excessive to add I18n as an interface dependency. This revision forward-declares the usage of KLocalizedString and makes I18n a private dependency. This avoids I18n leaking into dependent libraries.

This will break code implicitly depending on KTextWidget's I18n dependency, as well as code that implicitly depens on KPluralHandlingSpinBox KlocalizedString include. The fix is to explicitly link against I18n and explicitly include KLocalizedString respectively. I'm not sure how breaking changes are handled in KDE Frameworks. If breaking changes are not an option this revision can be closed.

Diff Detail

Repository
R310 KTextWidgets
Lint
Lint Skipped
Unit
Unit Tests Skipped
daandemeyer created this revision.Jul 26 2019, 10:47 PM
Restricted Application added a subscriber: kde-frameworks-devel. ยท View Herald TranscriptJul 26 2019, 10:47 PM
daandemeyer requested review of this revision.Jul 26 2019, 10:47 PM