Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-7454

Use sensible defaults instead of validation checks

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • Not Evaluated
    • None
    • None
    • Model and Rewriter
    • None
    • QDS Berlin - 2022 Week 35/36, QDS Berlin - 2022 Week 37/38, QDS Berlin - 2022 Week 39/40

    Description

      In the model there can be invalid states. Mostly because of the removal of elements. Originally my idea was that strong checks would force people to fix their ownership. So if a node is removed all owned model nodes would be checked. But because it is much easier to fix a crash(caused by the exceptions) at the point of the crash a simple isValid() check is used. This is leading to much code clutter. Over time people copied that approach as a new pattern and tested everywhere for invalid nodes. Even for invalid root notes which should not be possible.

      So my proposal is to remove the checks in the functions and simple return sensible defaults. So for an invalid node no parents, properties are returned etc..

      We even could remove the isValid check to force people to fix their ownership but I think that is too much work.

      We could add extra classes like "persistent model nodes" which would remove the invalid model nodes automatically. It would look like a list but would be connected to the view. If the node is removed or a model detached it would handle that case.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bubke Marco Bubke
            bubke Marco Bubke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes