forked from qt-creator/qt-creator
Utils: Fix toggling the "enabled" status
... of the first entry in a list of environment variables.
Commit 727be63dac
changed an assertion
from testing against end() to begin(), which was likely unintended.
Task-number: QTCREATORBUG-32495
Change-Id: I7814018d914219b4aebff70ab4aa6f185dbfcff0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -356,7 +356,7 @@ void EnvironmentModel::toggleVariable(const QModelIndex &idx)
|
|||||||
{
|
{
|
||||||
const QString name = indexToVariable(idx);
|
const QString name = indexToVariable(idx);
|
||||||
const auto newIt = d->m_resultNameValueDictionary.find(name);
|
const auto newIt = d->m_resultNameValueDictionary.find(name);
|
||||||
QTC_ASSERT(newIt != d->m_resultNameValueDictionary.begin(), return);
|
QTC_ASSERT(newIt != d->m_resultNameValueDictionary.end(), return);
|
||||||
const auto op = newIt.enabled() ? EnvironmentItem::SetDisabled : EnvironmentItem::SetEnabled;
|
const auto op = newIt.enabled() ? EnvironmentItem::SetDisabled : EnvironmentItem::SetEnabled;
|
||||||
const int changesPos = d->findInChanges(name);
|
const int changesPos = d->findInChanges(name);
|
||||||
if (changesPos != -1) {
|
if (changesPos != -1) {
|
||||||
|
Reference in New Issue
Block a user