🔴 PR 1: Critical Bug Fixes #2

Closed
clanker wants to merge 0 commits from fix/critical-bugs into master
Owner

Fixes

1. SearchPanel dirty property initialization

Initialize _dirty_content and _dirty_title before super().__init__() in SearchPanel. Previously these attributes only came into existence when the parent Panel.__init__ set self.dirty = True, triggering the property setter. If title() were ever called before that setter, it would crash with AttributeError.

2. Panel.focusInEvent broken type annotation

PyQt6.QWidget.QFocusEvent is not resolvable — PyQt6 is never imported as a module. Fixed to import QFocusEvent from PyQt6.QtGui and use it directly. Also consolidated the split QtCore imports.

3. Duplicate import os in app.py

Removed the duplicate import statement.

Files Changed

  • dodo/search.py: Initialize dirty attributes before super()
  • dodo/panel.py: Fix focusInEvent type annotation, consolidate imports
  • dodo/app.py: Remove duplicate import os

Testing

  • Launch dodo, navigate search panels — no crash
  • Focus events on panels work correctly
  • App starts normally
## Fixes ### 1. SearchPanel dirty property initialization Initialize `_dirty_content` and `_dirty_title` **before** `super().__init__()` in `SearchPanel`. Previously these attributes only came into existence when the parent `Panel.__init__` set `self.dirty = True`, triggering the property setter. If `title()` were ever called before that setter, it would crash with `AttributeError`. ### 2. Panel.focusInEvent broken type annotation `PyQt6.QWidget.QFocusEvent` is not resolvable — `PyQt6` is never imported as a module. Fixed to import `QFocusEvent` from `PyQt6.QtGui` and use it directly. Also consolidated the split `QtCore` imports. ### 3. Duplicate `import os` in app.py Removed the duplicate import statement. ## Files Changed - `dodo/search.py`: Initialize dirty attributes before super() - `dodo/panel.py`: Fix focusInEvent type annotation, consolidate imports - `dodo/app.py`: Remove duplicate `import os` ## Testing - Launch dodo, navigate search panels — no crash - Focus events on panels work correctly - App starts normally
- Initialize _dirty_content and _dirty_title before super().__init__
  in SearchPanel to prevent potential AttributeError on early title()
  calls (#1)

- Fix Panel.focusInEvent type annotation from unresolvable
  PyQt6.QWidget.QFocusEvent to proper QFocusEvent import (#2)

- Remove duplicate 'import os' in app.py (#3)
RulyTafzil closed this pull request 2026-07-24 20:36:43 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Home/lazarus!2
No description provided.