UI: Remove SignalBlocker

Since QSignalBlocker does the same thing, remove SignalBlocker.
This commit is contained in:
cg2121 2023-12-11 22:47:38 -06:00 committed by Lain
parent ea9df85512
commit 59766ee4ff
2 changed files with 4 additions and 17 deletions

View File

@ -86,19 +86,6 @@ void EnableThreadedMessageBoxes(bool enable);
void ExecThreadedWithoutBlocking(std::function<void()> func,
const QString &title, const QString &text);
class SignalBlocker {
QWidget *widget;
bool blocked;
public:
inline explicit SignalBlocker(QWidget *widget_) : widget(widget_)
{
blocked = widget->blockSignals(true);
}
inline ~SignalBlocker() { widget->blockSignals(blocked); }
};
void DeleteLayout(QLayout *layout);
static inline Qt::ConnectionType WaitConnection()

View File

@ -157,12 +157,12 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_)
std::bind(undo_redo, std::placeholders::_1, id, val),
uuid, uuid);
SignalBlocker sourcesSignalBlocker(this);
QSignalBlocker sourcesSignalBlocker(this);
obs_sceneitem_set_visible(sceneitem, val);
};
auto setItemLocked = [this](bool checked) {
SignalBlocker sourcesSignalBlocker(this);
QSignalBlocker sourcesSignalBlocker(this);
obs_sceneitem_set_locked(sceneitem, checked);
};
@ -447,7 +447,7 @@ void SourceTreeItem::ExitEditModeInternal(bool save)
/* ----------------------------------------- */
/* rename */
SignalBlocker sourcesSignalBlocker(this);
QSignalBlocker sourcesSignalBlocker(this);
std::string prevName(obs_source_get_name(source));
std::string scene_uuid =
obs_source_get_uuid(main->GetCurrentSceneSource());
@ -1485,7 +1485,7 @@ void SourceTree::selectionChanged(const QItemSelection &selected,
const QItemSelection &deselected)
{
{
SignalBlocker sourcesSignalBlocker(this);
QSignalBlocker sourcesSignalBlocker(this);
SourceTreeModel *stm = GetStm();
QModelIndexList selectedIdxs = selected.indexes();