From a4ee57322c38a98f883676b5a07f6479a8f212a8 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sun, 10 Mar 2024 22:28:40 +0200 Subject: Do not store licence file in a TQt form. Load it on runtime instead, like the TDE Licence Info application does. Signed-off-by: Mavridis Philippe --- style/config/polyesterconf.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'style/config/polyesterconf.cpp') diff --git a/style/config/polyesterconf.cpp b/style/config/polyesterconf.cpp index 2df304a..a114084 100755 --- a/style/config/polyesterconf.cpp +++ b/style/config/polyesterconf.cpp @@ -35,9 +35,12 @@ DEALINGS IN THE SOFTWARE. #include #include #include +#include +#include #include #include #include +#include #include #include @@ -211,12 +214,33 @@ PolyesterStyleConfig::PolyesterStyleConfig(TQWidget* parent): TQWidget(parent) dialog_->checkMarkColor->setEnabled(true); else dialog_->checkMarkColor->setEnabled(false); + + dialog_->licenceBox->setText(readLicence()); } PolyesterStyleConfig::~PolyesterStyleConfig() { } +TQString PolyesterStyleConfig::readLicence() { + // code borrowed from TDE license dialog + // (C) 2023 TDE Developers + TQString licensePath = locate("data", TQString("LICENSES/GPL_V2")); + if (licensePath.isEmpty()) + { + return i18n("License file not found!"); + } + + TQFile licenseFile(licensePath); + if (licenseFile.open(IO_ReadOnly)) + { + TQTextStream txtstr(&licenseFile); + return txtstr.read(); + } + + return i18n("Unable to open license file!"); +} + void PolyesterStyleConfig::save() { -- cgit v1.2.1