From 0b53638a75cf66357fc16639cbfd011b61e8e5db Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 8 Apr 2014 06:32:25 +0200 Subject: [PATCH] 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: Eike Ziller --- share/qtcreator/welcomescreen/examples.qml | 7 +------ src/plugins/qtsupport/exampleslistmodel.cpp | 11 ----------- src/plugins/qtsupport/exampleslistmodel.h | 2 -- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/share/qtcreator/welcomescreen/examples.qml b/share/qtcreator/welcomescreen/examples.qml index 5dc5d53bde6..53d77a0d3bf 100644 --- a/share/qtcreator/welcomescreen/examples.qml +++ b/share/qtcreator/welcomescreen/examples.qml @@ -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 { diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index ebab7763180..22f4bf66d1f 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -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; diff --git a/src/plugins/qtsupport/exampleslistmodel.h b/src/plugins/qtsupport/exampleslistmodel.h index ae30ec9290f..6a2607de741 100644 --- a/src/plugins/qtsupport/exampleslistmodel.h +++ b/src/plugins/qtsupport/exampleslistmodel.h @@ -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)