Recent

Author Topic: Adding a dependency on LazUtils to widgetset classes?  (Read 969 times)

dsiders

  • Hero Member
  • *****
  • Posts: 1325
Adding a dependency on LazUtils to widgetset classes?
« on: April 21, 2024, 09:40:36 pm »
This question results from trying to clean up the hundreds of warnings introduced by deprecating DbgS(),  DbgSName(), and others  in lclproc.pas.

Two of the affected units are wslclclasses.pp and wsproc.pp. To resolve the warnings, you'd have to add lazloggerbase to these units (and introduce a dependency on LazUtils).

Isn't that verboten in widgetset classes? And if so, the deprecated routines can never be removed from lclproc.pas... so why deprecate them?

Curious minds wanna know...
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4541
  • I like bugs.
Re: Adding a dependency on LazUtils to widgetset classes?
« Reply #1 on: April 21, 2024, 10:55:37 pm »
Sorry, I forgot to check and clean the deprecated messages from Lazarus sources caused by deprecating those Debug procedures.

LCLBase already depends on LazUtils through the FreeTypeLaz package.
LazLoggerBase can be added to any uses section without problems. Can you please do it?
LazUtils has the least amount of dependencies and can be used in console programs.
LCLBase and LCL pull a GUI library dependency with them. It is important to move code that is not specific to GUI out of LCL. Especially unit LCLProc had lots of such code.

The ongoing effort is to reduce dependencies. It makes the code more modular and improves it.
The Lazarus package system is already in its own package IdePackager. Removing LCL dependency from it is realistic but requires some refactoring.
The project related code is much harder. It contains sessions and is tied to the IDE. Requires much more refactoring. :(
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

dsiders

  • Hero Member
  • *****
  • Posts: 1325
Re: Adding a dependency on LazUtils to widgetset classes?
« Reply #2 on: April 22, 2024, 01:41:16 am »
Sorry, I forgot to check and clean the deprecated messages from Lazarus sources caused by deprecating those Debug procedures.
LCLBase already depends on LazUtils through the FreeTypeLaz package.
LazLoggerBase can be added to any uses section without problems. Can you please do it?

I can, but I'll submit them as one patch per unit. And there's gonna be several of them.

LazUtils has the least amount of dependencies and can be used in console programs.
LCLBase and LCL pull a GUI library dependency with them. It is important to move code that is not specific to GUI out of LCL. Especially unit LCLProc had lots of such code.

The ongoing effort is to reduce dependencies. It makes the code more modular and improves it.
The Lazarus package system is already in its own package IdePackager. Removing LCL dependency from it is realistic but requires some refactoring.
The project related code is much harder. It contains sessions and is tied to the IDE. Requires much more refactoring. :(

I wasn't planning to do anything with IDE code. Just LCL and LazUtils.

They'll show up on the Issue Tracker when I have patches.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

dsiders

  • Hero Member
  • *****
  • Posts: 1325
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

 

TinyPortal © 2005-2018