mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-20 08:15:46 -05:00
Fix item selection not updating correctly
* Remove could lead to the "add" dialog being opened * Rename could result in some entries not being renamed (due to FilterComboBox using a QComboBox with setEditable() set to true)
This commit is contained in:
@@ -397,23 +397,21 @@ TwitchConnectionSelection::TwitchConnectionSelection(QWidget *parent)
|
||||
|
||||
void TwitchConnectionSelection::SetToken(const std::string &token)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
if (!!GetTwitchTokenByName(token)) {
|
||||
_selection->setCurrentText(QString::fromStdString(token));
|
||||
SetItem(token);
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
void TwitchConnectionSelection::SetToken(
|
||||
const std::weak_ptr<TwitchToken> &token_)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
auto token = token_.lock();
|
||||
if (token) {
|
||||
SetToken(token->Name());
|
||||
SetItem(token->Name());
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user