forked from qt-creator/qt-creator
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:
@@ -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 {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user