Commit 0b53638a authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Revert "Welcome: Store examples search text in settings"

This reverts commit 894ade6f1e2767a8866642a4ea278659730c26d8

Storing the search text was not thought well through. It causes bad user experience.

Also, the real solution for showing filtered Example sets in the chooser is coming here: https://codereview.qt-project.org/#change,82906



Change-Id: Ibb51bf5c0fa08fdeb8530a19d823ba97a3c167d1
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 5ba6fc01
......@@ -56,13 +56,8 @@ Rectangle {
anchors.right: parent.right
anchors.leftMargin: 18
text: examplesModel.readSearchStringsFromSettings()
placeholderText: qsTr("Search in Examples...")
onTextChanged: {
examplesModel.parseSearchString(text);
examplesModel.writeSearchStringToSettings(text);
}
onTextChanged: examplesModel.parseSearchString(text)
}
ComboBox {
......
......@@ -54,7 +54,6 @@ static bool debugExamples()
}
static const char kSelectedExampleSetKey[] = "WelcomePage/SelectedExampleSet";
static const char kExamplesSearchStringKey[] = "WelcomePage/ExamplesSearchString";
void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const
{
......@@ -842,16 +841,6 @@ void ExamplesListModelFilter::filterForExampleSet(int index)
m_sourceModel->selectExampleSet(index);
}
void ExamplesListModelFilter::writeSearchStringToSettings(const QString &string)
{
Core::ICore::settings()->setValue(QLatin1String(kExamplesSearchStringKey), string);
}
QString ExamplesListModelFilter::readSearchStringsFromSettings()
{
return Core::ICore::settings()->value(QLatin1String(kExamplesSearchStringKey)).toString();
}
void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
{
m_showTutorialsOnly = showTutorialsOnly;
......
......@@ -185,8 +185,6 @@ public:
QAbstractItemModel* exampleSetModel();
Q_INVOKABLE void filterForExampleSet(int index);
Q_INVOKABLE void writeSearchStringToSettings(const QString &string);
Q_INVOKABLE QString readSearchStringsFromSettings();
public slots:
void setFilterTags(const QStringList &arg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment