mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-13 04:37:14 -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:
@@ -298,23 +298,21 @@ ConnectionSelection::ConnectionSelection(QWidget *parent)
|
||||
|
||||
void ConnectionSelection::SetConnection(const std::string &con)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
if (!!GetConnectionByName(con)) {
|
||||
_selection->setCurrentText(QString::fromStdString(con));
|
||||
SetItem(con);
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectionSelection::SetConnection(
|
||||
const std::weak_ptr<Connection> &connection_)
|
||||
{
|
||||
const QSignalBlocker blocker(_selection);
|
||||
auto connection = connection_.lock();
|
||||
if (connection) {
|
||||
SetConnection(connection->Name());
|
||||
SetItem(connection->Name());
|
||||
} else {
|
||||
_selection->setCurrentIndex(-1);
|
||||
SetItem("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user