summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2020-05-25 14:04:54 +0200
committerChristian Stenger <christian.stenger@qt.io>2020-05-26 09:23:09 +0000
commit0aa1a3ad4ba5899929d84c12977adc5e188cb4ee (patch)
tree6835b01eebd5f90e964e3ee4d1c2c20dbe3cb149
parent949bb0e67bbf6e7d8208dad9876382ef8ce5eb59 (diff)
downloadqt-creator-0aa1a3ad4ba5899929d84c12977adc5e188cb4ee.tar.gz
Revert "JsonWizard: Fix restoreLastHistoryItem for LineEdit"
This reverts commit e3abd5b3486e117ae1f5880a8304221699f5b14c as it broke updating evaluating line edits. Change-Id: Ie729a63d6a2b87df7143aba26726b657cffb8148 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp13
-rw-r--r--src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h2
2 files changed, 2 insertions, 13 deletions
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
index 6f141fe58e..6a7ecbbcd6 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
+++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
@@ -561,7 +561,7 @@ bool LineEditField::validate(MacroExpander *expander, QString *message)
m_currentText.clear();
}
} else {
- setDefaultText(w, expander);
+ w->setText(expander->expand(m_defaultText));
m_isModified = false;
}
} else {
@@ -579,7 +579,7 @@ void LineEditField::initializeData(MacroExpander *expander)
auto w = qobject_cast<FancyLineEdit *>(widget());
QTC_ASSERT(w, return);
m_isValidating = true;
- setDefaultText(w, expander);
+ w->setText(expander->expand(m_defaultText));
w->setPlaceholderText(m_placeholderText);
m_isModified = false;
m_isValidating = false;
@@ -595,15 +595,6 @@ QVariant LineEditField::toSettings() const
return qobject_cast<FancyLineEdit *>(widget())->text();
}
-void LineEditField::setDefaultText(FancyLineEdit *edit, MacroExpander *expander)
-{
- if (!edit->text().isEmpty())
- return;
-
- const QString expandedText = expander->expand(m_defaultText);
- edit->setText(expandedText);
-}
-
// --------------------------------------------------------------------
// TextEditFieldData:
// --------------------------------------------------------------------
diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
index 4a30dae395..6e91500b8e 100644
--- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
+++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h
@@ -111,8 +111,6 @@ private:
void fromSettings(const QVariant &value) override;
QVariant toSettings() const override;
- void setDefaultText(Utils::FancyLineEdit *edit, Utils::MacroExpander *expander);
-
bool m_isModified = false;
bool m_isValidating = false;
bool m_restoreLastHistoryItem = false;