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 <eike.ziller@digia.com>
This commit is contained in:
Alessandro Portale
2014-04-08 06:32:25 +02:00
parent 5ba6fc0195
commit 0b53638a75
3 changed files with 1 additions and 19 deletions

View File

@@ -56,13 +56,8 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: 18 anchors.leftMargin: 18
text: examplesModel.readSearchStringsFromSettings()
placeholderText: qsTr("Search in Examples...") placeholderText: qsTr("Search in Examples...")
onTextChanged: { onTextChanged: examplesModel.parseSearchString(text)
examplesModel.parseSearchString(text);
examplesModel.writeSearchStringToSettings(text);
}
} }
ComboBox { ComboBox {

View File

@@ -54,7 +54,6 @@ static bool debugExamples()
} }
static const char kSelectedExampleSetKey[] = "WelcomePage/SelectedExampleSet"; static const char kSelectedExampleSetKey[] = "WelcomePage/SelectedExampleSet";
static const char kExamplesSearchStringKey[] = "WelcomePage/ExamplesSearchString";
void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const
{ {
@@ -842,16 +841,6 @@ void ExamplesListModelFilter::filterForExampleSet(int index)
m_sourceModel->selectExampleSet(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) void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
{ {
m_showTutorialsOnly = showTutorialsOnly; m_showTutorialsOnly = showTutorialsOnly;

View File

@@ -185,8 +185,6 @@ public:
QAbstractItemModel* exampleSetModel(); QAbstractItemModel* exampleSetModel();
Q_INVOKABLE void filterForExampleSet(int index); Q_INVOKABLE void filterForExampleSet(int index);
Q_INVOKABLE void writeSearchStringToSettings(const QString &string);
Q_INVOKABLE QString readSearchStringsFromSettings();
public slots: public slots:
void setFilterTags(const QStringList &arg) void setFilterTags(const QStringList &arg)