From 7702541d81e231dd95e7a837993d6bef75ece51d Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 17 Jun 2024 22:03:49 +0200 Subject: [PATCH] Cleanup * Increase update frequency of AutoUpdateTooltipLabel * Prevent crash in TempVariableRef::PostLoad() * Ensure that correct widget is passed for MacroSelection connections --- lib/macro/macro-selection.cpp | 8 +++++--- lib/utils/temp-variable.cpp | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/macro/macro-selection.cpp b/lib/macro/macro-selection.cpp index bb363912..179b2fc5 100644 --- a/lib/macro/macro-selection.cpp +++ b/lib/macro/macro-selection.cpp @@ -19,11 +19,13 @@ MacroSelection::MacroSelection(QWidget *parent) addItem(QString::fromStdString(m->Name())); } - QWidget::connect(parent, SIGNAL(MacroAdded(const QString &)), this, + QWidget::connect(GetSettingsWindow(), + SIGNAL(MacroAdded(const QString &)), this, SLOT(MacroAdd(const QString &))); - QWidget::connect(parent, SIGNAL(MacroRemoved(const QString &)), this, + QWidget::connect(GetSettingsWindow(), + SIGNAL(MacroRemoved(const QString &)), this, SLOT(MacroRemove(const QString &))); - QWidget::connect(parent, + QWidget::connect(GetSettingsWindow(), SIGNAL(MacroRenamed(const QString &, const QString &)), this, SLOT(MacroRename(const QString &, const QString &))); diff --git a/lib/utils/temp-variable.cpp b/lib/utils/temp-variable.cpp index 9138dd89..5555d837 100644 --- a/lib/utils/temp-variable.cpp +++ b/lib/utils/temp-variable.cpp @@ -182,6 +182,10 @@ void TempVariableRef::Load(obs_data_t *obj, Macro *macro, const char *name) void TempVariableRef::PostLoad(int idx, SegmentType type, Macro *macro) { + if (!macro) { + return; + } + std::deque> segments; switch (type) { case SegmentType::NONE: @@ -458,7 +462,7 @@ void AutoUpdateTooltipLabel::enterEvent(QEnterEvent *event) void AutoUpdateTooltipLabel::enterEvent(QEvent *event) #endif { - _timer->start(1000); + _timer->start(300); QLabel::enterEvent(event); }