From a3b3d25c1dc88c2f70edba212341fbf2b6f12fec Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 9 Oct 2013 09:11:02 +0200 Subject: [PATCH] Cleanup remove accidentally committed file. Change-Id: I956f50d6390e8d502f47a89892bf318ca276e170 Reviewed-by: Thomas Hartmann --- ...s-for-the-filter-combobox-for-exampl.patch | 144 ------------------ 1 file changed, 144 deletions(-) delete mode 100644 src/plugins/0001-WelcomePage-fixes-for-the-filter-combobox-for-exampl.patch diff --git a/src/plugins/0001-WelcomePage-fixes-for-the-filter-combobox-for-exampl.patch b/src/plugins/0001-WelcomePage-fixes-for-the-filter-combobox-for-exampl.patch deleted file mode 100644 index 9860746c23..0000000000 --- a/src/plugins/0001-WelcomePage-fixes-for-the-filter-combobox-for-exampl.patch +++ /dev/null @@ -1,144 +0,0 @@ -From d39debcd0e4ce78df47597cea7e27df1964a1820 Mon Sep 17 00:00:00 2001 -From: Thomas Hartmann -Date: Wed, 12 Jun 2013 15:43:47 +0200 -Subject: [PATCH] WelcomePage: fixes for the filter combobox for examples - -"All Versions" did not work correctly and just contributed to -confusion. So it is removed. Since we need a sensible default -setting we now search for the Qt with the highest version that has -examples and demos. - -Change-Id: I495252a99753ebe511b598c61a79bbb0cd293e40 ---- - src/plugins/qtsupport/exampleslistmodel.cpp | 73 ++++++++++++++++++++------- - 1 files changed, 54 insertions(+), 19 deletions(-) - -diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp -index baad189..d6603c1 100644 ---- a/src/plugins/qtsupport/exampleslistmodel.cpp -+++ b/src/plugins/qtsupport/exampleslistmodel.cpp -@@ -48,13 +48,13 @@ - namespace QtSupport { - namespace Internal { - --const int allQtVersionsId = -0xff; -+const int noQtVersionsId = -0xff; - static const char currentQtVersionFilterSettingsKeyC[] = "WelcomePageQtVersionFilter"; - - int uniqueQtVersionIdSetting() - { - QSettings *settings = Core::ICore::settings(); -- int id = settings->value(QLatin1String(currentQtVersionFilterSettingsKeyC), allQtVersionsId).toInt(); -+ int id = settings->value(QLatin1String(currentQtVersionFilterSettingsKeyC), noQtVersionsId).toInt(); - return id; - } - -@@ -77,6 +77,38 @@ public: - setRoleNames(roleNames); - } - -+ int findHightestQtVersion() -+ { -+ QtVersionManager *versionManager = QtVersionManager::instance(); -+ QList qtVersions = versionManager->validVersions(); -+ -+ BaseQtVersion *newVersion = 0; -+ -+ foreach (BaseQtVersion *version, qtVersions) { -+ -+ if (version->isValid() && version->hasDemos() && version->hasExamples()) { -+ if (!newVersion) { -+ newVersion = version; -+ } else { -+ if (version->qtVersion() > newVersion->qtVersion()) { -+ newVersion = version; -+ } else if (version->qtVersion() == newVersion->qtVersion() -+ && version->uniqueId() < newVersion->uniqueId()) { -+ newVersion = version; -+ } -+ } -+ } -+ } -+ -+ if (!newVersion && !qtVersions.isEmpty()) -+ newVersion = qtVersions.first(); -+ -+ if (!newVersion) -+ return noQtVersionsId; -+ -+ return newVersion->uniqueId(); -+ } -+ - void setupQtVersions() - { - beginResetModel(); -@@ -90,30 +122,33 @@ public: - if (defaultVersion && qtVersions.contains(defaultVersion)) - qtVersions.move(qtVersions.indexOf(defaultVersion), 0); - -- QStandardItem *newItem = new QStandardItem(); -- newItem->setData(tr("All Versions"), Qt::UserRole + 1); -- newItem->setData(allQtVersionsId, Qt::UserRole + 2); -- appendRow(newItem); -- - int qtVersionSetting = uniqueQtVersionIdSetting(); -- if (qtVersionSetting != allQtVersionsId) { -+ int newQtVersionSetting = noQtVersionsId; -+ if (qtVersionSetting != noQtVersionsId) { - //ensure that the unique Qt id is valid -- int newQtVersionSetting = allQtVersionsId; - foreach (BaseQtVersion *version, qtVersions) { -- if (version->uniqueId() == qtVersionSetting) -+ if (version->uniqueId() == qtVersionSetting) { - newQtVersionSetting = qtVersionSetting; -+ } - } -+ } - -- if (newQtVersionSetting != qtVersionSetting) { -- setUniqueQtVersionIdSetting(newQtVersionSetting); -- } -+ if (newQtVersionSetting == noQtVersionsId) { -+ newQtVersionSetting = findHightestQtVersion(); -+ } -+ -+ if (newQtVersionSetting != qtVersionSetting) { -+ setUniqueQtVersionIdSetting(newQtVersionSetting); - } - -+ - foreach (BaseQtVersion *version, qtVersions) { -- QStandardItem *newItem = new QStandardItem(); -- newItem->setData(version->displayName(), Qt::UserRole + 1); -- newItem->setData(version->uniqueId(), Qt::UserRole + 2); -- appendRow(newItem); -+ if (version->hasDemos() || version->hasExamples()) { -+ QStandardItem *newItem = new QStandardItem(); -+ newItem->setData(version->displayName(), Qt::UserRole + 1); -+ newItem->setData(version->uniqueId(), Qt::UserRole + 2); -+ appendRow(newItem); -+ } - } - endResetModel(); - } -@@ -147,7 +182,7 @@ ExamplesListModel::ExamplesListModel(QObject *parent) : - m_updateOnQtVersionsChanged(false), - m_initialized(false), - m_helpInitialized(false), -- m_uniqueQtId(allQtVersionsId) -+ m_uniqueQtId(noQtVersionsId) - { - QHash roleNames; - roleNames[Name] = "name"; -@@ -517,7 +552,7 @@ QStringList ExamplesListModel::exampleSources(QString *examplesInstallPath, QStr - foreach (BaseQtVersion *version, qtVersions) { - - //filter for qt versions -- if (version->uniqueId() != m_uniqueQtId && m_uniqueQtId != allQtVersionsId) -+ if (version->uniqueId() != m_uniqueQtId && m_uniqueQtId != noQtVersionsId) - continue; - - // qt5 with examples OR demos manifest --- -1.7.6.msysgit.0 - -- GitLab