Commit 334f787
committed
Qt: drop unused includes and split MainWindow constructor
* Drop three unused Qt includes:
- ui_qt.h: QDialog, QStyledItemDelegate. Both are still needed in
ui_qt_widgets.h (PlaylistEntryDialog inherits QDialog,
ThumbnailDelegate inherits QStyledItemDelegate), and ui_qt.h
pulls in ui_qt_widgets.h, so consumers continue to get them
transitively for free.
- ui_qt_widgets.h: QTabWidget. Not used in this header at all.
* Split MainWindow::MainWindow body into helpers. The constructor
was 446 body lines of mixed widget creation, layout assembly,
model setup, file-system configuration, dock setup, and signal
wiring, with locals declared at the top and used hundreds of
lines later. Five private methods now own the chunks that don't
cross-depend:
- setupPlaylistFooter() builds the zoom slider, view-type and
thumbnail-type push buttons, items count label, and grid
progress widget, attaching them under the playlist views.
- setupModels() configures the playlist + filesystem proxy
models and the table / file-table / grid views.
- setupFileSystemBrowser() configures the QFileSystemModels
(filters, root paths) and the directory tree view.
- setupDockWidgets() owns the search / core-info / log dock
widgets, including the searchResetButton that previously lived
as a constructor local.
- setupSignalConnections() owns the bulk of the QObject::connect
block plus the m_dirTree initial-selection and m_thumbnailTimer
setup that was interleaved with it.
Constructor body: 446 -> 101 lines.
* Three small file-static helpers collapse repeated boilerplate:
- qt_button_set_action_label() replaces the
setDefaultAction(new QAction(msg_hash_to_str(label), btn)) +
setFixedSize(sizeHint()) pair (5 sites).
- qt_dock_add_to() replaces the
addDockWidget(static_cast<Qt::DockWidgetArea>(
dock->property("default_area").toInt()), dock)
idiom (7 sites).
- qt_dock_configure() replaces a setObjectName / setProperty(
"default_area") / setProperty("menu_text") / setWidget
four-line block (6 sites).
No behaviour change.1 parent d49ccc1 commit 334f787
3 files changed
Lines changed: 249 additions & 194 deletions
0 commit comments