Skip to content

Fix casts of Auth class in specialized constructors #13443

@Warchamp7

Description

@Warchamp7

Things like the OBSYouTubeActions dialog can reasonably only use the YouTube version of the Auth object.

OBSYoutubeActions::OBSYoutubeActions(QWidget *parent, Auth *auth, bool broadcastReady)
: QDialog(parent),
ui(new Ui::OBSYoutubeActions),
apiYouTube(dynamic_cast<YoutubeApiWrappers *>(auth)),
workerThread(new WorkerThread(apiYouTube)),
broadcastReady(broadcastReady)

Rather than taking an Auth and performing a cast, this dialog should take a YoutubeApiWrappers and rely on the caller to perform the cast and ensure it's valid.

This is only one example of this issue, and anyone handling this task should investigate other such examples and fix all of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/cleanupNon-breaking change which makes code smaller or more readablekind/tech-debt

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions